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(); |
| | |
| | | this.DeleteDevice(device); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除我的喜爱的设备 |
| | | /// </summary> |
| | | /// <param name="device">要删除的设备对象</param> |
| | | public void DeleteLoveDevice(CommonDevice device) |
| | | { |
| | | if (device == null) |
| | | { |
| | | return; |
| | | } |
| | | //我的喜爱 |
| | | var loveRoom = this.GetLoveRoom();
|
| | | if (loveRoom != null)
|
| | | {
|
| | | string deviceFile = device.FilePath;
|
| | | //移除缓存
|
| | | if (loveRoom.DeviceUIFilePathList.Contains(deviceFile) == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | loveRoom.DeviceUIFilePathList.Remove(deviceFile);
|
| | | loveRoom.DeviceUIList.RemoveAll((obj) => obj.FileName == deviceFile);
|
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 获取设备_________________________ |