From b9cb076fe6127160c96c35bf9c8cebcffe1d5ccd Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 10 一月 2020 17:35:23 +0800
Subject: [PATCH] 2020.1.10

---
 ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs |   41 +++++++++++++++++++++--------------------
 1 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
old mode 100755
new mode 100644
index b3aae17..a14d05a
--- a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
@@ -46,9 +46,9 @@
         /// </summary>
         public int OldIconPathType;
 
-        CommonDevice temperDevice;
+        public CommonDevice temperDevice;
 
-        CommonDevice humidDevice;
+        public CommonDevice humidDevice;
 
         DeviceInfoRow temperatureRow;
 
@@ -107,7 +107,7 @@
                         //鏄惁涓哄綋鍓嶈澶�
                         if ((temperDevice?.DeviceEpoint != common.DeviceEpoint || temperDevice?.DeviceAddr != common.DeviceAddr) && (humidDevice?.DeviceEpoint != common.DeviceEpoint || humidDevice?.DeviceAddr != common.DeviceAddr))
                         {
-                            //return;
+                            return;
                         }
 
                         //if (common.Type == DeviceType.TemperatureSensor)
@@ -204,11 +204,11 @@
 
         }
 
-        public override void RemoveFromParent()
-        {
-            ZbGateway.StatusList.Remove(this);
+        public override void RemoveFromParent()
+        {
+            ZbGateway.StatusList.Remove(this);
             CommonPage.Instance.IsDrawerLockMode = false;
-            base.RemoveFromParent();
+            base.RemoveFromParent();
         }
 
         #region Add____________________________________
@@ -250,7 +250,6 @@
                 ImagePath = "Room/Room_Rectangle.png"
             };
             bodyFrameLayout.AddChidren(backGround1);
-
 
             backGround = new ImageView()
             {
@@ -350,6 +349,7 @@
                         return;
                     }
                     room.TemperatrueDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}";
+                    temperDevice=Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
                     temperatureRow.SetTitle(R.MyInternationalizationString.Getting);
                     //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护
                     ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(selectTemp);
@@ -359,8 +359,8 @@
             {
                 temperatureRow.SetTitle(room.Temperatrue == 0 ? "--鈩�" : $"{room.Temperatrue}鈩�");
                 //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护
-                var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
-                ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(dev);
+                temperDevice = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice);
+                ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(temperDevice);
             }
             else
             {
@@ -387,6 +387,7 @@
                         return;
                     }
                     room.HumidityDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}";
+                    humidDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
                     humidityRow.SetTitle(R.MyInternationalizationString.Getting);
 
                     //鍙戦�佽幏鍙栨箍搴︾殑鍛戒护
@@ -397,8 +398,8 @@
             {
                 humidityRow.SetTitle(room.Humidity == 0 ? "--%" : $"{room.Humidity}%");
                 //鍙戦�佽幏鍙栨箍搴︾殑鍛戒护
-                var dev = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
-                ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(dev);
+                humidDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice);
+                ReadDeviceAttributeLogic.Instance.SendHumidityStatuComand(humidDevice);
             }
             else
             {
@@ -408,7 +409,7 @@
             if (Config.Instance.Home.FloorDics.Count == 0 || room.IsLove)
             {
                 temperatureRow.Y = Application.GetRealHeight(308);
-                humidityRow.Y= Application.GetRealHeight(446);
+                humidityRow.Y = Application.GetRealHeight(446);
             }
 
             var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127);
@@ -552,10 +553,10 @@
                 var fileName = $"RoomIcon_{tradeTime}.png";
                 //閫氳繃鐩告満鎷嶇収瑁佸壀
                 CropImage.TakePicture((imagePath) =>
-                {
-                    if (string.IsNullOrEmpty(imagePath) == true)
-                    {
-                        return;
+                {
+                    if (string.IsNullOrEmpty(imagePath))
+                    {
+                        return;
                     }
                     if (IconPathType != 0)
                     {
@@ -578,9 +579,9 @@
                 //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
                 CropImage.SelectPicture((imagePath) =>
                 {
-                    if (string.IsNullOrEmpty(imagePath) == true)
-                    {
-                        return;
+                    if (string.IsNullOrEmpty(imagePath))
+                    {
+                        return;
                     }
                     if (IconPathType != 0)
                     {

--
Gitblit v1.8.0