old mode 100755
new mode 100644
| | |
| | | //设备(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(); |
| | |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public List<Room> GetRoomsByFloorId(string id) |
| | | public List<Room> GetRoomsByFloorId(string id) |
| | | { |
| | | return Lists.FindAll((obj) => obj.FloorId==id); |
| | | if (Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | return Lists; |
| | | } |
| | | return Lists.FindAll((obj) => obj.FloorId == id); |
| | | } |
| | | /// <summary> |
| | | /// 获取当前楼层的房间名称 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public List<string> GetRoomNamesByFloorId(string id) |
| | | public List<string> GetRoomNamesByFloorId(string id) |
| | | { |
| | | List<string> names = new List<string> { }; |
| | | foreach(var r in Lists) |
| | | foreach (var r in Lists) |
| | | { |
| | | if(r.FloorId==id) |
| | | if (r.FloorId == id) |
| | | { |
| | | names.Add(r.Name); |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public List<Room> GetRoomsByFloorIdAppendLoveRoom(string id) |
| | | { |
| | | if (Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | return Lists; |
| | | } |
| | | var r= Lists.FindAll((obj) => obj.FloorId == id); |
| | | r.Insert(0, GetLoveRoom()); |
| | | return r; |
| | |
| | | public void AddDevice(string deviceUIFilePath) |
| | | { |
| | | if (string.IsNullOrEmpty(deviceUIFilePath)) |
| | | { |
| | | return; |
| | | |
| | | { |
| | | return; |
| | | } |
| | | var deviceUI = Common.LocalDevice.Current.GetDeviceUI(deviceUIFilePath); |
| | | if (null == deviceUI.CommonDevice) |
| | |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | |
| | | var getSceneIdAllData = await ZigBee.Device.Scene.GetSceneNewIdAsync(sceneName); |
| | | if (getSceneIdAllData == null || getSceneIdAllData.getSceneIdData == null) |
| | | { |
| | |
| | | }
|
| | |
|
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |