old mode 100755
new mode 100644
| | |
| | | |
| | | /// <summary>
|
| | | /// 温度传感器(设备主键)
|
| | | /// </summary> |
| | | /// </summary> |
| | | public string TemperatrueDevice = string.Empty; |
| | | /// <summary>
|
| | | /// 湿度传感器(设备主键)
|
| | |
| | | /// <summary> |
| | | /// 温度 |
| | | /// </summary> |
| | | public double Temperatrue; |
| | | public decimal Temperatrue; |
| | | /// <summary> |
| | | /// 湿度 |
| | | /// </summary> |
| | | public double Humidity; |
| | | public decimal Humidity; |
| | | |
| | | /// <summary>
|
| | | /// 当前选择的房间
|
| | |
| | | room.Name = $"{room.Name}"; |
| | | } |
| | | Lists.Add(room); |
| | | |
| | | |
| | | } |
| | | } |
| | | Config.Instance.Home.InitFloor(); |
| | |
| | | //设备(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(); |
| | |
| | | /// <param name="addCommons">Add commons.</param> |
| | | public async System.Threading.Tasks.Task<int> ModifyScene(SceneUI sceneUI, Scene.SceneRemoveMemberData sceneRemoveMemberData, List<Scene.AddSceneMemberData> addCommons) |
| | | { |
| | | if (AllRoomSceneUIList.Find(s => s.Name == sceneUI.Name) == null) |
| | | { |
| | | return 0; |
| | | } |
| | | //if (AllRoomSceneUIList.Find(s => s.Name == sceneUI.Name) == null) |
| | | //{ |
| | | // return 0; |
| | | //} |
| | | |
| | | bool result = true; |
| | | //移除成员 返回结果 |
| | |
| | | SceneUIList.Remove(sceneUI); |
| | | SceneUIFilePathList.Remove(sceneUI.FileName); |
| | | Save(); |
| | | if (IsLove == false) |
| | | { |
| | | if (CurrentRoom.GetLoveRoom().SceneUIList.Find((obj) => obj.Id == sceneUI.Id) != null) |
| | | { |
| | | CurrentRoom.GetLoveRoom().DeleteScene(sceneUI); |
| | | } |
| | | } |
| | | Global.DeleteFilebyHomeId(sceneUI.FileName); |
| | | HdlAutoBackupLogic.DeleteFile(sceneUI.FileName); |
| | | } |