From 466d9904486acf9d1d5082298f1541579fff262d Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 09 七月 2021 12:24:11 +0800
Subject: [PATCH] 最后的版本

---
 ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
index 9e3b9e4..55ae1c5 100755
--- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
@@ -536,6 +536,11 @@
                         {
                             cardContr = new Controls.DeviceAirQualitySensorRowControl();
                         }
+                        else
+                        {
+                            //娓╂箍搴�
+                            cardContr = new Controls.DeviceTemperatureRowControl();
+                        }
                     }
                     //褰╃伅(璋冨厜鍣�)
                     else if (device.Type == DeviceType.DimmableLight)
@@ -546,11 +551,6 @@
                     else if (device.Type == DeviceType.IASZone)
                     {
                         cardContr = new Controls.DeviceSensorRowControl();
-                    }
-                    //娓╂箍搴�
-                    else if (device.Type == DeviceType.TemperatureSensor)
-                    {
-                        cardContr = new Controls.DeviceTemperatureRowControl();
                     }
                     //闂ㄩ攣
                     else if (device.Type == DeviceType.DoorLock)
@@ -563,7 +563,7 @@
                         cardContr = new Controls.DeviceColorTemperatureRowControl();
                     }
                     //鏃犳硶璇嗗埆
-                    else
+                    if (cardContr == null)
                     {
                         cardContr = new Controls.DeviceRowCommon();
                         //娌℃湁鐘舵�佸姛鑳�
@@ -861,10 +861,13 @@
                     string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
                     //鏅捐。鏋朵笂鎶ラ渶瑕佺壒娈婂鐞嗭紝鍏朵粬涓婃姤鐨勫洖璺粺涓�杞负绔偣1
                     var tempList = LocalDevice.Current.GetDevicesByMac(report.DeviceAddr);
-                    var tempDeviceEnum = LocalDevice.Current.GetMyDeviceEnumInfo(tempList);
-                    if (tempDeviceEnum.ConcreteType == Common.DeviceConcreteType.Airer)
+                    if (tempList.Count > 0)
                     {
-                        mainKeys = report.DeviceAddr + "_" + 1;
+                        var tempDeviceEnum = LocalDevice.Current.GetMyDeviceEnumInfo(tempList);
+                        if (tempDeviceEnum.ConcreteType == Common.DeviceConcreteType.Airer)
+                        {
+                            mainKeys = report.DeviceAddr + "_" + 1;
+                        }
                     }
                     if (this.dicDeviceRowControl.ContainsKey(mainKeys) == true)
                     {

--
Gitblit v1.8.0