Esempio n. 1
0
        public TestModule(TestTwin defaultTwin = null)
        {
            Twin.SetDefault(defaultTwin ?? _defaultTwin);

            Twin.Subscribe(async twin =>
            {
                Logger.LogInformation("Twin update");

                await Twin.ReportAsync(twin);
                return(TwinResult.Ok);
            });
        }
Esempio n. 2
0
        public TemperatureSensor(TemperatureTwin defaultTwin = null)
        {
            _startTimeStamp = DateTime.Now;

            Twin.SetDefault(defaultTwin ?? _defaultTwin);

            Twin.Subscribe(async twin =>
            {
                Logger.LogInformation("Twin update");

                ConfigureGenerator(twin);
                await Twin.ReportAsync(twin);
                return(TwinResult.Ok);
            });
        }