From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期二, 30 八月 2022 09:37:38 +0800 Subject: [PATCH] 合并了IOS的代码 --- ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 66 ++++++++++++++++++++++++++++++-- 1 files changed, 61 insertions(+), 5 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs old mode 100755 new mode 100644 index 0dee854..20b9eea --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs @@ -462,7 +462,13 @@ //搴曠嚎 btnRow.AddBottomLine(); - var doorLock = (ZigBee.Device.DoorLock)listNewDevice[0]; + var doorLock = (ZigBee.Device.DoorLock)listNewDevice[0]; + ///鍊间负绌哄啀鍘昏鍙栨湰鍦� + if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword)) + { + ///璇诲彇鏈湴杩滅▼寮�閿佸瘑鐮侊紝鐪嬬湅涔嬪墠鏄惁閰嶇疆杩� + doorLock.RemoteUnlockPassword = ReadLocalPassword(); + } if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword) == false) { btnswitch.IsSelected = true; @@ -518,7 +524,24 @@ }; } } - + /// <summary> + /// 淇濆瓨杩滅▼闂ㄩ攣瀵嗙爜 + /// </summary> + /// <param name="password">瀵嗙爜</param> + public void SaveLocalPassword(string password) { + var bytes = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(password)); + IO.FileUtils.WriteFileByBytes(Config.Instance.HomeId + "_" + Config.Instance.Guid, bytes); + } + /// <summary> + /// 璇诲彇杩滅▼闂ㄩ攣瀵嗙爜 + /// </summary> + /// <returns></returns> + public string ReadLocalPassword() + { + var str = System.Text.Encoding.UTF8.GetString(IO.FileUtils.ReadFile(Config.Instance.HomeId + "_" + Config.Instance.Guid)); + //Newtonsoft.Json.JsonConvert.DeserializeObject<瀵瑰儚>(str); + return str; + } #endregion #region 鈻� 闂ㄩ攣鏃堕棿(闂ㄩ攣)_____________________ @@ -784,10 +807,11 @@ //鍙湁鍥炶矾鏁板ぇ浜�1鎵嶈兘鏈夎繖涓彍鍗� if (Common.LocalDevice.Current.GetDevicesCountByMac(listNewDevice[0].DeviceAddr) == 1) { - //鏂伴灏忔ā鍧楀彧鏈変竴涓洖璺紝浣嗚姹傛柊椋庡皬妯″潡鐨勬柊椋庢湁鍔熻兘璁剧疆 + //绌烘皵璐ㄩ噺浼犳劅鍣ㄥ拰鏂伴灏忔ā鍧楀彧鏈変竴涓洖璺紝浣嗚姹傛柊椋庡皬妯″潡鐨勬柊椋庢湁鍔熻兘璁剧疆 //鏅捐。鏋堕粯璁ゅ彧瀛樺偍绗竴鍥炶矾锛屽叾浠栧洖璺杩囨护浜� bool isSpecial = false; - if (deviceEnumInfo.ConcreteType == DeviceConcreteType.Relay_FangyueFreshAirModul) + if (deviceEnumInfo.ConcreteType == DeviceConcreteType.Relay_FangyueFreshAirModul || + deviceEnumInfo.ConcreteType == DeviceConcreteType.AirQualitySensor) { isSpecial = true; } @@ -1200,6 +1224,7 @@ if (string.IsNullOrEmpty(bindName)) { btnHumidityStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); + bindHumidityDev = null; } else { @@ -1251,6 +1276,7 @@ if (string.IsNullOrEmpty(bindName)) { btnTemperatureStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); + bindTemperatureDev = null; } else { @@ -1334,6 +1360,8 @@ { continue; } + //鑾峰彇璁惧绫诲瀷鐨� + var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); if (device.Type == DeviceType.TemperatureSensor) { var bD = device as TemperatureSensor; @@ -1347,11 +1375,39 @@ bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device); bindHumidityDev = device; } + + //绌烘皵璐ㄩ噺浼犳劅鍣� + if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) + { + if (bDev.BindCluster == 1026) + { + bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); + bindTemperatureDev = device; + } + if (bDev.BindCluster == 1029) + { + bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); + bindHumidityDev = device; + } + } } if (device.Type == DeviceType.FreshAirHumiditySensor) { bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device); bindHumidityDev = device; + } + else if (device.Type == DeviceType.PMSensor) + { + if (bDev.BindCluster == 1026) + { + bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); + bindTemperatureDev = device; + } + if (bDev.BindCluster == 1029) + { + bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); + bindHumidityDev = device; + } } } result = true; @@ -1602,7 +1658,7 @@ } }, ShowErrorMode.NO); } - }); + }, ShowErrorMode.NO); } #endregion -- Gitblit v1.8.0