gxc
2019-11-15 05ce435c3b58e53eeab04c672affdeeab75f3036
ZigbeeApp/Shared/Common/Room.cs
old mode 100755 new mode 100644
@@ -445,8 +445,21 @@
                    //设备(deviceUI)
                    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();
@@ -765,8 +778,9 @@
        public void AddDevice(string deviceUIFilePath)
        {
            if (string.IsNullOrEmpty(deviceUIFilePath))
            {
                return;
             {
                 return;
            }
            var deviceUI = Common.LocalDevice.Current.GetDeviceUI(deviceUIFilePath);
            if (null == deviceUI.CommonDevice)
@@ -994,7 +1008,7 @@
                    return -1;
                }
            }
            var getSceneIdAllData = await ZigBee.Device.Scene.GetSceneNewIdAsync(sceneName);
            if (getSceneIdAllData == null || getSceneIdAllData.getSceneIdData == null)
            {
@@ -1480,6 +1494,6 @@
        }
        #endregion
    }
}