From 490696fba6c1f1318e088c439ee81d536126581b Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 18 五月 2020 10:35:26 +0800
Subject: [PATCH] 优化门锁远程问题

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs |   33 +++++++++++++++++++++++++--------
 1 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
old mode 100755
new mode 100644
index 49ce8de..7182c20
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
@@ -53,6 +53,10 @@
         /// 琚粦鐩爣鏄疨M2.5
         /// </summary>
         private CommonDevice bindPMDev;
+        // <summary>
+        /// 鎸夐敭涓缁戝畾鐨勭洰鏍囧垪琛�
+        /// </summary>
+        public List<BindObj.BindListResponseObj> bindList = new List<BindObj.BindListResponseObj>();
 
         #endregion
 
@@ -204,7 +208,7 @@
 
             rowNewWind.ButtonClickEvent += (sender, e) =>
             {
-                var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindFreshAirDev, 1);
+                var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindFreshAirDev, bindList, 1);
                 Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
                 Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                 addDevicePage.Show();
@@ -241,9 +245,9 @@
             var panelBindListRes = await curControlDev.GetDeviceBindAsync();
             if (panelBindListRes != null && panelBindListRes.getAllBindResponseData != null)
             {
-                foreach (var bDev in panelBindListRes.getAllBindResponseData.BindList)
+                bindList = panelBindListRes.getAllBindResponseData.BindList;
+                foreach (var bDev in bindList)
                 {
-                    curControlDev.bindList.Add(bDev);
                     var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
 
                     if (device.Type == DeviceType.FreshAir)
@@ -279,8 +283,21 @@
                     }
                     if (device.Type == DeviceType.PMSensor)
                     {
-                        bindPmName = device.DeviceEpointName;
-                        bindPMDev = device;
+                        if (bDev.BindCluster == 1026)
+                        {
+                            bindTemperatureName = device.DeviceEpointName;
+                            bindTemperatureDev = device;
+                        }
+                        if (bDev.BindCluster == 1029)
+                        {
+                            bindHumidityName = device.DeviceEpointName;
+                            bindHumidityDev = device;
+                        }
+                        if (bDev.BindCluster == 1066)
+                        {
+                            bindPmName = device.DeviceEpointName;
+                            bindPMDev = device;
+                        }
                     }
                 }
                 result = true;
@@ -310,7 +327,7 @@
             var btnPMStatu = rowPM.AddMostRightView(msg, 700);
             rowPM.ButtonClickEvent += (sender, e) =>
             {
-                var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindPMDev, 4);
+                var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindPMDev, bindList, 4);
                 Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
                 Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                 addDevicePage.Show();
@@ -355,7 +372,7 @@
             var btnTemperatureStatu = rowTemPerature.AddMostRightView(msg, 700);
             rowTemPerature.ButtonClickEvent += (sender, e) =>
             {
-                var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindTemperatureDev, 2);
+                var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindTemperatureDev, bindList, 2);
                 Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
                 Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                 addDevicePage.Show();
@@ -400,7 +417,7 @@
             var btnHumidityStatu = rowHumidity.AddMostRightView(msg, 700);
             rowHumidity.ButtonClickEvent += (sender, e) =>
             {
-                var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindHumidityDev, 3);
+                var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindHumidityDev, bindList, 3);
                 Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage);
                 Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                 addDevicePage.Show();

--
Gitblit v1.8.0