From d78515ac4ac8cf4a1785d9df18058d6724f12b79 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 14 一月 2021 19:34:59 +0800
Subject: [PATCH] 合并xm2021-01-13  wjc2021-02-06

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
index 9290671..3d9b62d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -1201,6 +1201,7 @@
                         if (string.IsNullOrEmpty(bindName))
                         {
                             btnHumidityStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing);
+                            bindHumidityDev = null;
                         }
                         else
                         {
@@ -1252,6 +1253,7 @@
                         if (string.IsNullOrEmpty(bindName))
                         {
                             btnTemperatureStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing);
+                            bindTemperatureDev = null;
                         }
                         else
                         {
@@ -1335,6 +1337,8 @@
                     {
                         continue;
                     }
+                    //鑾峰彇璁惧绫诲瀷鐨�
+                    var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
                     if (device.Type == DeviceType.TemperatureSensor)
                     {
                         var bD = device as TemperatureSensor;
@@ -1348,12 +1352,40 @@
                             bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device);
                             bindHumidityDev = device;
                         }
+
+                        //绌烘皵璐ㄩ噺浼犳劅鍣�
+                        if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
+                        {
+                            if (bDev.BindCluster == 1026)
+                            {
+                                bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
+                                bindTemperatureDev = device;
+                            }
+                            if (bDev.BindCluster == 1029)
+                            {
+                                bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
+                                bindHumidityDev = device;
+                            }
+                        }
                     }
                     if (device.Type == DeviceType.FreshAirHumiditySensor)
                     {
                         bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device);
                         bindHumidityDev = device;
                     }
+                    else if (device.Type == DeviceType.PMSensor)
+                    {
+                        if (bDev.BindCluster == 1026)
+                        {
+                            bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
+                            bindTemperatureDev = device;
+                        }
+                        if (bDev.BindCluster == 1029)
+                        {
+                            bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
+                            bindHumidityDev = device;
+                        }
+                    }
                 }
                 result = true;
             }

--
Gitblit v1.8.0