From eb5a57942bae8eb57fd7fb61124c247bebb67e8e Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期五, 19 六月 2020 10:18:28 +0800 Subject: [PATCH] Merge branch 'dev-tzy' into dev-2020xm --- Home0618/Shared/Phone/Device/CommonForm/RoomView.cs | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Home0618/Shared/Phone/Device/CommonForm/RoomView.cs b/Home0618/Shared/Phone/Device/CommonForm/RoomView.cs index 9a5f16c..ee7df2a 100755 --- a/Home0618/Shared/Phone/Device/CommonForm/RoomView.cs +++ b/Home0618/Shared/Phone/Device/CommonForm/RoomView.cs @@ -233,14 +233,15 @@ if (report.DeviceAddr == humidDevice.DeviceAddr && report.DeviceEpoint == humidDevice.DeviceEpoint) { HdlThreadLogic.Current.RunMain(() => - { - if (((TemperatureSensor)temperDevice).Humidity == 0) + { + decimal humidity = (decimal)humidDevice.GetType().InvokeMember("Humidity", System.Reflection.BindingFlags.GetField, null, humidDevice, null); + if (humidity == 0) { humidityText.Text = "--%"; } else { - humidityText.Text = ((TemperatureSensor)temperDevice).Humidity + "%"; + humidityText.Text = humidity + "%"; } }, ShowErrorMode.NO); } -- Gitblit v1.8.0