From 34e965100d635346e2d4cd6e6013bdaed66b3004 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 02 一月 2020 19:52:13 +0800
Subject: [PATCH] 2019.1.2-3

---
 ZigbeeApp/Shared/Common/Room.cs |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/ZigbeeApp/Shared/Common/Room.cs b/ZigbeeApp/Shared/Common/Room.cs
old mode 100755
new mode 100644
index 5d8d500..9db970d
--- a/ZigbeeApp/Shared/Common/Room.cs
+++ b/ZigbeeApp/Shared/Common/Room.cs
@@ -69,7 +69,7 @@
 
         /// <summary>
         /// 娓╁害浼犳劅鍣�(璁惧涓婚敭)
-        /// </summary>   
+        /// </summary>
         public string TemperatrueDevice = string.Empty;
         /// <summary>
         /// 婀垮害浼犳劅鍣�(璁惧涓婚敭)
@@ -78,11 +78,11 @@
         /// <summary>
         /// 娓╁害
         /// </summary>
-        public double Temperatrue;
+        public decimal Temperatrue;
         /// <summary>
         /// 婀垮害
         /// </summary>
-        public double Humidity;
+        public decimal Humidity;
 
         /// <summary>
         /// 褰撳墠閫夋嫨鐨勬埧闂�
@@ -332,7 +332,7 @@
                         room.Name = $"{room.Name}";
                     }
                     Lists.Add(room);
-                   
+
                 }
             }
             Config.Instance.Home.InitFloor();
@@ -538,8 +538,21 @@
                     //璁惧锛坉eviceUI锛�
                     beforeRoom.DeviceUIList.Clear();
                     foreach (var deviceFilePath in beforeRoom.DeviceUIFilePathList)
-                    {
-                        beforeRoom.DeviceUIList.Add(Common.LocalDevice.Current.GetDeviceUI(deviceFilePath));
+                    {
+                        var jsonInfo = Encoding.UTF8.GetString(Global.ReadFileByHomeId(deviceFilePath));
+                        var tempDeviceUI = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceUI>(jsonInfo);
+                        if (tempDeviceUI != null)
+                        {
+                            var delCommon = tempDeviceUIList.Find((obj) => obj.CommonDevice != null && tempDeviceUI.CommonDevice != null && obj.CommonDevice.Type == tempDeviceUI.CommonDevice.Type && obj.CommonDevice.CommonDeviceAddrEpoint == tempDeviceUI.CommonDevice.CommonDeviceAddrEpoint);
+                            if (delCommon != null)
+                            {
+                                beforeRoom.DeviceUIList.Add(delCommon);
+                            }
+                            else
+                            {
+                                beforeRoom.AddDevice(deviceFilePath);
+                            }
+                        }
                     }
                     //鍦烘櫙(SceneUI)
                     beforeRoom.SceneUIList.Clear();

--
Gitblit v1.8.0