Beispiel #1
0
 public RinserDevice(string id, string primaryKey, string schema, string jsonSchemaFile, string iotHub)
     : base(id, primaryKey, schema, jsonSchemaFile, iotHub)
 {
     Telemetry = new RinserTelemetry()
     {
         online    = true,
         running   = true,
         producing = true
     };
 }
Beispiel #2
0
        private async Task <MethodResponse> TurnOffCommandHandler(MethodRequest methodRequest, object userContext)
        {
            try
            {
                Console.WriteLine($"{Id}.{nameof(TurnOffCommandHandler)}...");

                Telemetry = new RinserTelemetry();

                await SendMessageAsync(Telemetry);

                return(new MethodResponse(0));
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Exception on {Id}.{nameof(TurnOffCommandHandler)}: {ex.Message}");
                return(new MethodResponse(-1));
            }
        }