Beispiel #1
0
        private async Task InitDeviceAsync()
        {
            await pnpClient.ReportPropertyAsync("serialNumber", serialNumber);

            await pnpClient.ReportComponentPropertyCollectionAsync("deviceInfo", DeviceInfo.ThisDeviceInfo.ToDictionary());

            var targetTemp1 = await pnpClient.ReadDesiredComponentPropertyAsync <double>("thermostat1", "targetTemperature");

            CurrentTemperature1 = targetTemp1;
            var targetTemp2 = await pnpClient.ReadDesiredComponentPropertyAsync <double>("thermostat2", "targetTemperature");

            CurrentTemperature2 = targetTemp2;
        }
        public async Task NoComponentReportProperty()
        {
            await pnpClient.ReportPropertyAsync("prop1", "val1");

            Assert.Equal("val1", mockClient.ReportedCollection["prop1"].Value);
        }