From e90209beae6a4e822cecb18e6889f8bda23f630e Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 14 十二月 2020 11:16:06 +0800
Subject: [PATCH] 合并了晾衣架(非新云端)

---
 ZigbeeApp/Shared/Common/Device.cs |  819 +++++++++++++++-------------------------------------------
 1 files changed, 216 insertions(+), 603 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCommonLogic.cs b/ZigbeeApp/Shared/Common/Device.cs
similarity index 83%
rename from ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCommonLogic.cs
rename to ZigbeeApp/Shared/Common/Device.cs
index f075ec2..78875ab 100644
--- a/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCommonLogic.cs
+++ b/ZigbeeApp/Shared/Common/Device.cs
@@ -1,33 +1,33 @@
-锘縰sing System;
+锘縰sing Shared.Phone.UserCenter;
+using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
 using ZigBee.Device;
-using Shared.Common;
 
-namespace Shared.Phone
+namespace Shared.Common
 {
     /// <summary>
-    /// 璁惧鐨勫叡閫氶�昏緫
+    /// 鏈湴璁惧
     /// </summary>
-    public class HdlDeviceCommonLogic
+    public class LocalDevice
     {
         #region 鈻� 鍙橀噺澹版槑___________________________
 
         /// <summary>
-        /// 璁惧鐨勫叡閫氶�昏緫
+        /// 鏈湴璁惧
         /// </summary>
-        private static HdlDeviceCommonLogic m_Current = null;
+        private static LocalDevice m_Current = null;
         /// <summary>
-        /// 璁惧鐨勫叡閫氶�昏緫
+        /// 鏈湴璁惧
         /// </summary>
-        public static HdlDeviceCommonLogic Current
+        public static LocalDevice Current
         {
             get
             {
                 if (m_Current == null)
                 {
-                    m_Current = new HdlDeviceCommonLogic();
+                    m_Current = new LocalDevice();
                 }
                 return m_Current;
             }
@@ -106,7 +106,7 @@
                 try
                 {
                     //璇诲彇瀹冪殑鍐呭
-                    var fileData = HdlFileLogic.Current.ReadFileTextContent(System.IO.Path.Combine(Common.Config.Instance.FullPath, file));
+                    var fileData = HdlFileLogic.Current.ReadFileTextContent(System.IO.Path.Combine(Config.Instance.FullPath, file));
                     var jobject = Newtonsoft.Json.Linq.JObject.Parse(fileData);
                     if (jobject.Property("DeviceID") == null)
                     {
@@ -125,7 +125,7 @@
                 //濡傛灉杩欎釜璁惧鐨勭綉鍏矷D涓嶅瓨鍦ㄧ殑璇�
                 if (HdlGatewayLogic.Current.IsGatewayExist(device.CurrentGateWayId) == false)
                 {
-                    if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 3)
+                    if (UserCenterResourse.UserInfo.AuthorityNo == 3)
                     {
                         //濡傛灉浠栨槸鎴愬憳鐨勮瘽,甯粬鏂板缓涓�涓綉鍏�
                         HdlGatewayLogic.Current.AddVirtualGateway(device.CurrentGateWayId);
@@ -144,6 +144,14 @@
                     //200绔彛涓嶉渶瑕佸鐞�
                     this.dicOTADevice[mainKey] = (OTADevice)device;
                     continue;
+                }
+                //濡傛灉璁惧鏄櫨琛f灦,鍒欎竴绔偣锛屽叾浠栫鐐癸紙2锝�5锛夎繃婊�,
+                //鍥犱负鍏朵粬绔偣鍙湁鎺у埗浣滅敤锛岋紙2:鎺у埗鐓ф槑锛�3:鎺у埗椋庡共锛�4:鎺у埗鐑樺共锛�5:鎺у埗娑堟瘨锛�
+                //浜у搧缁忕悊涓嶈鏄剧ず
+                if (device is Airer)
+                {
+                    if (device.DeviceEpoint == 2 || device.DeviceEpoint == 3 || device.DeviceEpoint == 4 || device.DeviceEpoint == 5)
+                        continue;
                 }
                 //娣诲姞缂撳瓨
                 this.dicAllDevice[mainKey] = device;
@@ -183,9 +191,11 @@
             }
             //鎴愬憳韬唤鐨勬椂鍊�,鍒犻櫎鎺夐潪娉曠殑缃戝叧鏂囦欢
             this.DeleteGatewayFileByMemberModel();
+            //鍒濆鍖栫墿鐞嗚澶囨墍灞炴埧闂寸殑璁板綍
+            HdlRoomLogic.Current.InitRealDeviceRoomId();
 
 #if DEBUG
-            if (HdlUserCenterResourse.HideOption.CenterHideMenu == 1)
+            if (UserCenterResourse.HideOption.CenterHideMenu == 1)
             {
                 //妫�娴嬩竴浜涗唬鐮侀厤缃�(debug)
                 this.CheckOhtherSettion();
@@ -198,7 +208,7 @@
         /// </summary>
         private void DeleteGatewayFileByMemberModel()
         {
-            if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 3)
+            if (UserCenterResourse.UserInfo.AuthorityNo != 3)
             {
                 return;
             }
@@ -317,7 +327,7 @@
                     dicExist.Remove(maikey);
                 }
                 //鑾峰彇璁惧鐨勫浐瀹氬睘鎬�
-                if (HdlDeviceAttributeLogic.Current.ReadDeviceAllFixedAttribute(device) == true)
+                if (HdlDeviceFixedAttributeLogic.Current.SetAllFixedAttributeToDevice(device) == true)
                 {
                     System.Threading.Thread.Sleep(200);
                 }
@@ -398,6 +408,15 @@
                 return;
             }
 
+            //濡傛灉璁惧鏄櫨琛f灦,鍒欎竴绔偣锛屽叾浠栫鐐癸紙2锝�5锛夎繃婊�,
+            //鍥犱负鍏朵粬绔偣鍙湁鎺у埗浣滅敤锛岋紙2:鎺у埗鐓ф槑锛�3:鎺у埗椋庡共锛�4:鎺у埗鐑樺共锛�5:鎺у埗娑堟瘨锛�
+            //浜у搧缁忕悊涓嶈鏄剧ず
+            if (device is Airer)
+            {
+                if (device.DeviceEpoint == 2 || device.DeviceEpoint == 3 || device.DeviceEpoint == 4 || device.DeviceEpoint == 5)
+                    return;
+            }
+
             lock (dicAllDevice)
             {
                 if (this.dicAllDevice.ContainsKey(mainKeys) == true)
@@ -448,6 +467,14 @@
                 device.ReSave();
                 return;
             }
+            //濡傛灉璁惧鏄櫨琛f灦,鍒欎竴绔偣锛屽叾浠栫鐐癸紙2锝�5锛夎繃婊�,
+            //鍥犱负鍏朵粬绔偣鍙湁鎺у埗浣滅敤锛岋紙2:鎺у埗鐓ф槑锛�3:鎺у埗椋庡共锛�4:鎺у埗鐑樺共锛�5:鎺у埗娑堟瘨锛�
+            //浜у搧缁忕悊涓嶈鏄剧ず
+            if (device is Airer)
+            {
+                if (device.DeviceEpoint == 2 || device.DeviceEpoint == 3 || device.DeviceEpoint == 4 || device.DeviceEpoint == 5)
+                    return;
+            }
             this.dicAllDevice[mainKeys] = device;
 
             //璁惧鍥炶矾鏀堕泦
@@ -489,7 +516,7 @@
 
             //涓嶅啀妫�娴嬪悕瀛楁槸鍚︿竴鏍�
             //鎴愬憳鍙兘淇敼鑷繁鏈湴鐨勫悕瀛�
-            if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 3)
+            if (UserCenterResourse.UserInfo.AuthorityNo != 3)
             {
                 var result = this.RenameDeviceNameAsync(device, newName);
                 if (result == null || result.deviceRenameData == null || result.deviceRenameData.Result == 1)
@@ -497,7 +524,7 @@
                     //璁惧鍚嶇О淇敼澶辫触
                     string msg = Language.StringByID(R.MyInternationalizationString.uDeviceReNameFail);
                     //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                    msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
+                    msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
 
                     if (mode == ShowErrorMode.YES)
                     {
@@ -542,7 +569,7 @@
             CommonDevice device = listDevice[0];
             //涓嶅啀妫�娴嬪悕瀛楁槸鍚︿竴鏍�
             //鎴愬憳鍙兘淇敼鑷繁鏈湴鐨勫悕瀛�
-            if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 3)
+            if (UserCenterResourse.UserInfo.AuthorityNo != 3)
             {
                 //淇敼鐗╃悊鍚嶅瓧
                 var result = this.RenameDeviceMacNameAsync(device, newMacName);
@@ -551,7 +578,7 @@
                     //璁惧鍚嶇О淇敼澶辫触
                     string msg = Language.StringByID(R.MyInternationalizationString.uDeviceReNameFail);
                     //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                    msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
+                    msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                     if (mode == ShowErrorMode.YES)
                     {
                         this.ShowErrorMsg(msg);
@@ -772,7 +799,7 @@
                     //璁惧鍒犻櫎澶辫触
                     string msg = Language.StringByID(R.MyInternationalizationString.uDeviceDeleteFail);
                     //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                    msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
+                    msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
 
                     this.ShowErrorMsg(msg);
                     return false;
@@ -831,7 +858,7 @@
             string filePath = device.FilePath;
             if (Global.IsExistsByHomeId(filePath) == true)
             {
-                if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 3)
+                if (UserCenterResourse.UserInfo.AuthorityNo == 3)
                 {
                     //鎴愬憳鐨勮瘽,鐩存帴鍒犻櫎,娌℃湁鍟嗛噺鐨勪綑鍦�
                     Global.DeleteFilebyHomeId(filePath);
@@ -860,7 +887,7 @@
                 string otaFile = this.dicOTADevice[otaKeys].FilePath;
                 if (Global.IsExistsByHomeId(otaFile) == true)
                 {
-                    if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 3)
+                    if (UserCenterResourse.UserInfo.AuthorityNo == 3)
                     {
                         //鎴愬憳鐨勮瘽,鐩存帴鍒犻櫎,娌℃湁鍟嗛噺鐨勪綑鍦�
                         Global.DeleteFilebyHomeId(otaFile);
@@ -887,7 +914,7 @@
         public async Task<bool> SynchronizationDevice(List<CommonDevice> listdevice)
         {
             //铏氭嫙浣忓畢鐨勮瘽,涓嶉渶瑕佸垹闄ょ綉鍏崇殑璁惧
-            if (Common.Config.Instance.Home.IsVirtually == false)
+            if (Config.Instance.Home.IsVirtually == false)
             {
                 //鍚屾
                 var result = await listdevice[0].SyncMsgToBindSource(listdevice[0].DeviceAddr, listdevice[0].DeviceEpoint);
@@ -896,7 +923,7 @@
                     //鍚屾鍒犻櫎澶辫触
                     string msg = Language.StringByID(R.MyInternationalizationString.SynchronizationFailed);
                     //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
-                    msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
+                    msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
 
                     this.ShowErrorMsg(msg);
                     return false;
@@ -940,9 +967,9 @@
         /// <returns></returns>
         public bool DeviceIsCanFixedPosition(CommonDevice device)
         {
-            if (device.Type == DeviceType.DoorLock || device.Type == DeviceType.PMSensor)
+            if (device.Type == DeviceType.DoorLock || device.Type == DeviceType.Airer || device.Type == DeviceType.PMSensor)
             {
-                //闂ㄩ攣娌℃湁瀹氫綅鍔熻兘
+                //闂ㄩ攣鍜屾櫨琛f灦娌℃湁瀹氫綅鍔熻兘锛�
                 return false;
             }
             var myTypeInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
@@ -985,7 +1012,7 @@
         public bool DeviceIsCanSynchronization(CommonDevice device)
         {
             //鑾峰彇璁惧绫诲瀷鐨�
-            var deviceEnumInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
+            var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
             if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
             {
                 return true;
@@ -2372,6 +2399,22 @@
                 info.ConcreteType = DeviceConcreteType.ColorLight_Temperature;
                 info.ObjectTypeName = this.dicDeviceModelIdEnum["A420"].A绫诲瀷鍚嶅瓧;//璋冨厜妯″潡
             }
+            //17鏅捐。鏋�
+            else if (dicType.ContainsKey(DeviceType.Airer) == true)
+            {
+                info.ConcreteText = this.dicDeviceModelIdEnum["A421"].A瀹樻柟鍚嶅瓧;
+                info.BeloneType = DeviceBeloneType.A鏅捐。鏋�;
+                info.ConcreteType = DeviceConcreteType.Airer;
+                info.ObjectTypeName = this.dicDeviceModelIdEnum["A421"].A绫诲瀷鍚嶅瓧;
+            }
+            //18绌烘皵璐ㄩ噺浼犳劅鍣�
+            else if (dicType.ContainsKey(DeviceType.AirQualitySensor) == true)
+            {
+                info.ConcreteText = this.dicDeviceModelIdEnum["A422"].A瀹樻柟鍚嶅瓧;
+                info.BeloneType = DeviceBeloneType.A绌烘皵璐ㄩ噺;
+                info.ConcreteType = DeviceConcreteType.AirQualitySensor;
+                info.ObjectTypeName = this.dicDeviceModelIdEnum["A422"].A绫诲瀷鍚嶅瓧;
+            }
 
             //璁惧鎵�灞炵被鍨嬬殑缈昏瘧鍚嶅瓧
             info.BeloneText = info.ConcreteText;
@@ -2518,346 +2561,73 @@
 
         #endregion
 
-        #region 鈻� 鑾峰彇涓婚〉璁惧鐘舵�佺殑缈昏瘧鏂囨湰_________
-
+        #region 鈻� 鏅捐。鏋惰澶囨椂闂撮厤缃甠__________________________
         /// <summary>
-        /// 鑾峰彇涓婚〉璁惧鐘舵�佺殑缈昏瘧鏂囨湰
+        ///  璁剧疆鏅捐。鏋堕骞诧紝鐑樺共鍜屾秷姣掓椂闂�(璁剧疆澶辫触鏃讹紝浼氭樉绀轰俊鎭�)
+        ///  time:璁剧疆鐨勫垎閽�
         /// </summary>
-        /// <returns></returns>
-        public string GetMainPageDeviceStatuText(CommonDevice device)
+        /// <param name="litdevice">璁惧瀵硅薄(MAC鍦板潃蹇呴』瑕佺浉鍚�)</param>
+        public async Task<bool> SetAirerTimeDevice(List<CommonDevice> listdevice, Airer airer, int time, int controlEpoint)
         {
-            if (device.Type == DeviceType.OnOffOutput)
+            //铏氭嫙浣忓畢鐨勮瘽,涓嶉渶瑕�
+            if (Config.Instance.Home.IsVirtually == false)
             {
-                //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎
-                if (device.HadReadDeviceStatu == false)
+                foreach (var dev in listdevice)
                 {
-                    return Language.StringByID(R.MyInternationalizationString.uOffLine);
-                }
-                if ((device as ToggleLight).OnOffStatus == 1)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.uOpen1);
-                }
-                return Language.StringByID(R.MyInternationalizationString.Close);
-            }
-            else if (device.Type == DeviceType.AirSwitch)
-            {
-                //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎
-                if (device.HadReadDeviceStatu == false)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.uOffLine);
-                }
-                if ((device as AirSwitch).OnOffStatus == 1)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.uOpen1);
-                }
-                return Language.StringByID(R.MyInternationalizationString.Close);
-            }
-            else if (device.Type == DeviceType.DimmableLight)
-            {
-                //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎
-                if (device.HadReadDeviceStatu == false)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.uOffLine);
-                }
-                if ((device as DimmableLight).OnOffStatus == 0)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.Close);
-                }
-                return $"{(int)((device as DimmableLight).Level * 1.0 / 254 * 100)}%";
-            }
-            else if (device.Type == DeviceType.ColorTemperatureLight)
-            {
-                //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎
-                if (device.HadReadDeviceStatu == false)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.uOffLine);
-                }
-                if ((device as ColorTemperatureLight).OnOffStatus == 0)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.Close);
-                }
-                return $"{(int)((device as ColorTemperatureLight).Level * 1.0 / 254 * 100)}%";
-            }
-            else if (device.Type == DeviceType.WindowCoveringDevice)
-            {
-                //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎
-                if (device.HadReadDeviceStatu == false)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.uOffLine);
-                }
-                if ((device as Rollershade).WcdCurrentPositionLiftPercentage == 0)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.Close);
-                }
-                return $"{(device as Rollershade).WcdCurrentPositionLiftPercentage}%";
-            }
-            else if (device.Type == DeviceType.FreshAir)
-            {
-                //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎
-                if (device.HadReadDeviceStatu == false)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.uOffLine);
-                }
-
-                //妯″紡
-                string wind = string.Empty;
-                var freshAir = device as FreshAir;
-                if (freshAir.currentFanStatus == 0)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.Close);
-                }
-                if (freshAir.currentFanSpeed == 1)
-                {
-                    wind = Language.StringByID(R.MyInternationalizationString.Fan_Low);
-                }
-                else if (freshAir.currentFanSpeed == 2)
-                {
-                    wind = Language.StringByID(R.MyInternationalizationString.Fan_Middle);
-                }
-                else if (freshAir.currentFanSpeed == 3)
-                {
-                    wind = Language.StringByID(R.MyInternationalizationString.Fan_Height);
-                }
-                return $"{wind}";
-            }
-            else if (device.Type == DeviceType.PMSensor)
-            {
-                //绌烘皵璐ㄩ噺
-                string curQuality = "";
-                //娓╁害
-                string temperature = string.Empty;
-                //婀垮害
-                string humidity = string.Empty;
-                //PM2.5
-                string pm = string.Empty;
-                var pMSensor = device as PMSensor;
-                if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0)
-                {
-                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
-                }
-                else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35)
-                {
-                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
-                }
-                else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75)
-                {
-                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
-                }
-                else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115)
-                {
-                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
-                }
-                else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150)
-                {
-                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
-                }
-                else if (pMSensor.currentPmData > 250)
-                {
-                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
-                }
-                else
-                {
-                    curQuality = "--";
-                }
-
-                humidity = $"{pMSensor.currentHumidity}%";
-                temperature = $"{pMSensor.currentTemperature}鈩�";
-                pm = $"{pMSensor.currentPmData}渭g/m鲁";
-                return $"{curQuality},{pm},{temperature},{humidity}";
-
-            }
-            else if (device.Type == DeviceType.Thermostat)
-            {
-                //鍦ㄧ綉鍏虫病鏈夊洖澶嶄箣鍓�,榛樿绂荤嚎
-                if (device.HadReadDeviceStatu == false)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.uOffLine);
-                }
-                //娓╁害锛屾ā寮忥紝椋庨��
-                string tempareture = string.Empty;
-                string model = string.Empty;
-                string wind = string.Empty;
-
-                var ac = device as AC;
-
-                if (ac.currentSystemMode == 0)
-                {
-                    return Language.StringByID(R.MyInternationalizationString.Close);
-                }
-                else if (ac.currentSystemMode == 1)
-                {
-                    model = Language.StringByID(R.MyInternationalizationString.Mode_Auto);
-                    tempareture = $"{ac.currentAutoSetpoint} 鈩�";
-                }
-                else if (ac.currentSystemMode == 3)
-                {
-                    model = Language.StringByID(R.MyInternationalizationString.Mode_Cool);
-                    tempareture = $"{ac.currentCoolingSetpoint} 鈩�";
-                }
-                else if (ac.currentSystemMode == 4)
-                {
-                    model = Language.StringByID(R.MyInternationalizationString.Mode_Heat);
-                    tempareture = $"{ac.currentHeatingSetpoint} 鈩�";
-                }
-                else if (ac.currentSystemMode == 7)
-                {
-                    model = Language.StringByID(R.MyInternationalizationString.Mode_FanOnly);
-                }
-                else if (ac.currentSystemMode == 8)
-                {
-                    model = Language.StringByID(R.MyInternationalizationString.Mode_Dry);
-                    tempareture = $"{ac.currentCoolingSetpoint} 鈩�";
-                }
-
-                if (ac.currentFanMode == 1)
-                {
-                    wind = Language.StringByID(R.MyInternationalizationString.Fan_Low);
-                }
-                else if (ac.currentFanMode == 2)
-                {
-                    wind = Language.StringByID(R.MyInternationalizationString.Fan_Middle);
-                }
-                else
-                {
-                    wind = Language.StringByID(R.MyInternationalizationString.Fan_Height);
-                }
-
-                if (string.IsNullOrEmpty(tempareture))
-                {
-                    return $"{model},{wind}";
-                }
-                return $"{model},{wind},{tempareture}";
-            }
-            else if (device.Type == DeviceType.IASZone)
-            {
-                var ias = device as IASZone;
-                //鍖哄垎浼犳劅鍣ㄥ叿浣撶被鍨�
-                var info = HdlDeviceCommonLogic.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device });
-                if (info.ConcreteType == DeviceConcreteType.Sensor_Infrared)
-                {
-                    //绾㈠
-                    if (ias.iASInfo?.Alarm1 == 1)
+                    //璁剧疆灞炴�т俊鎭�
+                    CommonDevice.SetWritableValueData dataT = new CommonDevice.SetWritableValueData();
+                    dataT.Undivided = 0;
+                    dataT.AttributeId = 16385;
+                    dataT.AttributeDataType = 33;
+                    dataT.AttributeData = time;
+                    dev.DeviceEpoint = controlEpoint;//鏆傛椂鎹㈡垚鏅捐。鏋跺搴旂殑鎺у埗绔偣
+                    var result = await dev.SetWritableValueAsync(6, dataT);
+                    if (result == null || result.setWritableValueResponData == null || result.setWritableValueResponData.Status != 0)
                     {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_HavePerson);
+                        //璁剧疆澶辫触
+                        if (dev.DeviceEpoint == 3)
+                        {
+                            if (airer.WindTime != 0)
+                            {
+                                airer.WindTime = 0;
+                            }
+                            string msg = Language.StringByID(R.MyInternationalizationString.AirerWindTimeFailed);
+                            //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
+                            msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                            dev.DeviceEpoint = 1;//灏嗘櫨琛f灦瀵瑰簲鐨勬帶鍒剁鐐硅繕鍘熸垚1绔偣
+                            this.ShowErrorMsg(msg);
+                            return false;
+                        }
+                        if (dev.DeviceEpoint == 4)
+                        {
+                            if (airer.DryTime != 0)
+                            {
+                                airer.DryTime = 0;
+                            }
+                            string msg = Language.StringByID(R.MyInternationalizationString.AirerDryTimeFailed);
+                            //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
+                            msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                            dev.DeviceEpoint = 1;//灏嗘櫨琛f灦瀵瑰簲鐨勬帶鍒剁鐐硅繕鍘熸垚1绔偣
+                            this.ShowErrorMsg(msg);
+                            return false;
+                        }
+                        if (dev.DeviceEpoint == 5)
+                        {
+                            if (airer.DisinfectTime != 0)
+                            {
+                                airer.DisinfectTime = 0;
+                            }
+                            string msg = Language.StringByID(R.MyInternationalizationString.AirerDisinfectTimeFailed);
+                            //鎷兼帴涓娿�愮綉鍏冲洖澶嶈秴鏃躲�戠殑Msg
+                            msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
+                            this.ShowErrorMsg(msg);
+                            dev.DeviceEpoint = 1;//灏嗘櫨琛f灦瀵瑰簲鐨勬帶鍒剁鐐硅繕鍘熸垚1绔偣
+                            return false;
+                        }
                     }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_NoPerson);
-                }
-                else if (info.ConcreteType == DeviceConcreteType.Sensor_Water)
-                {
-                    //姘存蹈
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_HaveWater);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
-                }
-                else if (info.ConcreteType == DeviceConcreteType.Sensor_DoorWindow)
-                {
-                    //闂ㄧ獥
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Open);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Close);
-                }
-                else if (info.ConcreteType == DeviceConcreteType.Sensor_CarbonMonoxide)
-                {
-                    //鐕冩皵
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.uGasLeakage);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
-                }
-                else if (info.ConcreteType == DeviceConcreteType.Sensor_Fire)
-                {
-                    //鐑熼浘
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.uSmogAlarm);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Safe);
-                }
-                else if (info.ConcreteType == DeviceConcreteType.Sensor_Pir)
-                {
-                    //pir
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_HavePerson);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_NoPerson);
-                }
-                else if (info.ConcreteType == DeviceConcreteType.Sensor_Keyfob)
-                {
-                    //閽ュ寵鎵�
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
-                }
-                else if (info.ConcreteType == DeviceConcreteType.Sensor_Motion)
-                {
-                    //杩愬姩浼犳劅鍣�
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_HavePerson);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_NoPerson);
-                }
-                else if (info.ConcreteType == DeviceConcreteType.Sensor_EmergencyButton)
-                {
-                    //绱ф�ユ寜閽�
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
-                }
-                else if (info.ConcreteType == DeviceConcreteType.Sensor_SphericalMotion)
-                {
-                    //鐞冨瀷绉诲姩浼犳劅鍣�
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_HavePerson);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_NoPerson);
-                }
-                else
-                {
-                    //鍏朵粬浼犳劅鍣�
-                    if (ias.iASInfo?.Alarm1 == 1)
-                    {
-                        return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm);
-                    }
-                    return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal);
                 }
             }
-            else if (device.Type == DeviceType.TemperatureSensor)
-            {
-                var tempera = device as TemperatureSensor;
-                if (tempera.SensorDiv == 1)
-                {
-                    if (tempera.currentTemperature == 0)
-                    {
-                        return "0.0鈩�";
-                    }
-                    return $"{tempera.currentTemperature}鈩�";
-                }
-                else if (tempera.SensorDiv == 2)
-                {
-                    if (tempera.currentHumidity == 0)
-                    {
-                        return "--%";
-                    }
-                    return $"{tempera.currentHumidity}%";
-                }
-                return null;
-            }
-            else
-            {
-                return null;
-            }
+            return true;
         }
         #endregion
 
@@ -2914,7 +2684,7 @@
             //2020.03.30杩藉姞寮忔牱:濡傛灉鏄潰鏉跨殑娓╁害鎺㈠ご,涓嶆樉绀�
             else if (i_device.Type == DeviceType.TemperatureSensor && ((TemperatureSensor)i_device).SensorDiv == 1)
             {
-                var myInfoType = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device });
+                var myInfoType = LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device });
                 if (myInfoType.BeloneType == DeviceBeloneType.A鎸夐敭闈㈡澘)
                 {
                     return false;
@@ -2932,7 +2702,7 @@
             }
 
             //濡傛灉鏄柊椋庨潰鏉挎垨鐜闈㈡澘,鍒欓兘涓嶆樉绀轰换浣曞洖璺�
-            var myInfoTypeTemp = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device });
+            var myInfoTypeTemp = LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device });
             if (myInfoTypeTemp.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir || myInfoTypeTemp.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment)
             {
                 return false;
@@ -3222,7 +2992,7 @@
                         {
                             msg += "\r\n[" + HdlGatewayLogic.Current.GetGatewayName(localGw).ToString() + "]";
                         }
-                        msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, null, "鍥炲瓒呮椂", false);
+                        msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, null, "鍥炲瓒呮椂", false);
                         this.ShowTipMsg(msg);
                     }
                     statu = -1;
@@ -3311,7 +3081,7 @@
         private bool ReNewDeviceOnTypeIsChanged(CommonDevice oldLocalDevice, DeviceType newDeviceType)
         {
             //鍏堣幏鍙栨湰鍦拌繖涓棫璁惧瀵硅薄鐨刯son
-            string oldFile = System.IO.Path.Combine(Common.Config.Instance.FullPath, oldLocalDevice.FilePath);
+            string oldFile = System.IO.Path.Combine(Config.Instance.FullPath, oldLocalDevice.FilePath);
             var deviceData = HdlFileLogic.Current.ReadFileTextContent(oldFile);
             if (deviceData == null)
             {
@@ -3661,7 +3431,7 @@
             }
             this.dicDeviceModelIdEnum = new Dictionary<string, DeviceNameContent>();
 
-            var listText = HdlCommonLogic.Current.GetInitFileContent("DeviceName.ini");
+            var listText = this.GetDeviceNameFileContent();
             foreach (var dataText in listText)
             {
                 if (dataText == string.Empty || dataText.StartsWith(";") == true)
@@ -3708,264 +3478,63 @@
             this.dicPictrueShard["ButtonPanel_SimpleFour"] = "ButtonPanel_Four";//绠�绾�4鎸夐敭闈㈡澘 娌跨敤 4鎸夐敭鐨勫浘鏍�
             this.dicPictrueShard["ButtonPanel_SimpleThree"] = "ButtonPanel_Three";//绠�绾�3鎸夐敭闈㈡澘 娌跨敤 3鎸夐敭鐨勫浘鏍�
             this.dicPictrueShard["ButtonPanel_SimpleTwo"] = "ButtonPanel_Two";//绠�绾�2鎸夐敭闈㈡澘 娌跨敤 2鎸夐敭鐨勫浘鏍�
-            this.dicPictrueShard["IntelligentLocks_Sone"] = "IntelligentLocks_H06C";//S-one鐨勯棬閿佸浘鐗� 娌跨敤 H06C鐨勫浘鏍�
+            this.dicPictrueShard["IntelligentLocks_Sone"] = "IntelligentLocks_H06C";//S-One Pro鐨勯棬閿佸浘鐗� 娌跨敤 H06C鐨勫浘鏍�
+            this.dicPictrueShard["IntelligentLocks_AT1TF"] = "IntelligentLocks_H06C";//鍏ㄨ嚜鍔ㄦ櫤鑳介棬閿� AT-1TF鍥剧墖 娌跨敤 H06C鐨勫浘鏍�
+            this.dicPictrueShard["IntelligentLocks_AT1F"] = "IntelligentLocks_H06C";//鍏ㄨ嚜鍔ㄦ櫤鑳介棬閿� AT-1F鍥剧墖 娌跨敤 H06C鐨勫浘鏍�
+            this.dicPictrueShard["IntelligentLocks_AT1T"] = "IntelligentLocks_H06C";//鍏ㄨ嚜鍔ㄦ櫤鑳介棬閿� AT-1T鍥剧墖 娌跨敤 H06C鐨勫浘鏍�
+            this.dicPictrueShard["IntelligentLocks_HAT1B"] = "IntelligentLocks_H06C";//鏅鸿兘闂ㄩ攣 HAT-1B鍥剧墖 娌跨敤 H06C鐨勫浘鏍� 
+            this.dicPictrueShard["IntelligentLocks_HAT1T"] = "IntelligentLocks_H06C";//鏅鸿兘闂ㄩ攣 HAT-1T鍥剧墖 娌跨敤 H06C鐨勫浘鏍� 
+            this.dicPictrueShard["IntelligentLocks_ATFT"] = "IntelligentLocks_H06C";//鏅鸿兘闂ㄩ攣 HAT-1T鍥剧墖 娌跨敤 H06C鐨勫浘鏍�   
             this.dicPictrueShard["Relay_FangyueFreshAirModul"] = "Relay_ThreeLoad";//鏂规偊鏂伴灏忔ā鍧楀浘鐗� 娌跨敤 3璺户鐢靛櫒鐨勫浘鏍�
             this.dicPictrueShard["ButtonPanel_FourButtonScene"] = "ButtonPanel_Four";//绠�绾�4鎸夐敭鍦烘櫙闈㈡澘 娌跨敤 4鎸夐敭闈㈡澘鐨勫浘鏍�
         }
 
-        #endregion
-
-        #region 鈻� 鍙戦�佹暟鎹甠__________________________
-
         /// <summary>
-        /// 鍙戦�佹暟鎹埌缃戝叧锛屽苟鎺ュ彈缃戝叧杩斿洖鐨勬暟鎹�(闈為�忎紶,ReceiptData涓鸿繑鍥炲��)
+        /// 鑾峰彇璁惧鍚嶅瓧鏂囦欢鐨勫唴瀹�
         /// </summary>
-        /// <param name="device">璁惧瀵硅薄</param>
-        /// <param name="sendTopic">鍙戦�佺殑涓婚</param>
-        /// <param name="sendData">闇�瑕佸彂閫佺殑鏁版嵁  JObject.ToString()鐨勪笢瑗�</param>
-        /// <param name="receiptTopic">鎸囧畾鎺ユ敹鍝釜涓婚</param>
-        /// <param name="waitTime">瓒呮椂鏃堕棿(绉�)</param>
-        /// <returns>缃戝叧杩斿洖鐨勬暟鎹�</returns>
-        public ReceiptGatewayResult SendJobjectDataToGateway(CommonDevice device, string sendTopic, string sendData, string receiptTopic, int waitTime = 5)
+        /// <returns></returns>
+        private List<string> GetDeviceNameFileContent()
         {
-            //鍙戦�佹暟鎹埌缃戝叧锛屽苟鎺ュ彈缃戝叧杩斿洖鐨勬暟鎹�
-            return this.SendJobjectDataToGateway(device, sendTopic, sendData, new List<string>() { receiptTopic }, waitTime);
-        }
-
-        /// <summary>
-        /// 鍙戦�佹暟鎹埌缃戝叧锛屽苟鎺ュ彈缃戝叧杩斿洖鐨勬暟鎹�(闈為�忎紶),listReceiptData涓鸿繑鍥炲��(鍏ㄩ儴涓婚鍏ㄩ儴鎺ユ敹寰楀埌,鎵嶄細杩斿洖,涓嶇劧浼氳繑鍥炶秴鏃�)
-        /// </summary>
-        /// <param name="device">璁惧瀵硅薄</param>
-        /// <param name="sendTopic">鍙戦�佺殑涓婚</param>
-        /// <param name="sendData">闇�瑕佸彂閫佺殑鏁版嵁  JObject.ToString()鐨勪笢瑗�</param>
-        /// <param name="listReceiptTopic">鎸囧畾鎺ユ敹鍝簺涓婚</param>
-        /// <param name="waitTime">瓒呮椂鏃堕棿(绉�)</param>
-        /// <returns>缃戝叧杩斿洖鐨勬暟鎹�</returns>
-        public ReceiptGatewayResult SendJobjectDataToGateway(CommonDevice device, string sendTopic, string sendData, List<string> listReceiptTopic, int waitTime = 5)
-        {
-            var reResult = new ReceiptGatewayResult();
-            reResult.listReceiptData = new string[listReceiptTopic.Count];
-            reResult.JsonData = new string[listReceiptTopic.Count];
-
-            var myGateway = device.Gateway;
-            if (myGateway == null)
+            System.IO.StreamReader streamReader = null;
+            var listText = new List<string>();
+            try
             {
-                //鑾峰彇缃戝叧瀵硅薄澶辫触
-                reResult.ErrorMsg = Language.StringByID(R.MyInternationalizationString.uGetGatewayTagartFail);
-                reResult.ErrorMsgDiv = -1;
-                return reResult;
-            }
-            //缃戝叧ID
-            string gatewayID = device.Gateway.GwId;
-            //閿欒涓婚
-            string errorTopic = gatewayID + "/" + "Error_Respon";
-            //妫�娴嬪璞$殑涓婚
-            for (int i = 0; i < listReceiptTopic.Count; i++)
-            {
-                listReceiptTopic[i] = gatewayID + "/" + listReceiptTopic[i];
-            }
-
-            //钃濇墠鍒氭暣浜嗕釜鍚屼竴涓富棰樺彲鑳戒細鎺ㄩ�佸涓繃鏉ョ殑鏈鸿兘
-            var listCheckTopic = new HashSet<string>();
-            Action<string, string> receiptAction = (topic, message) =>
-            {
-                var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
-                //缃戝叧鍥炲閿欒
-                if (topic == errorTopic)
+#if iOS
+                string textFile = Foundation.NSBundle.MainBundle.PathForResource("DeviceName.ini", null);
+                streamReader = new System.IO.StreamReader(textFile, Encoding.UTF8);
+                string text;
+                while ((text = streamReader.ReadLine()) != null)
                 {
-                    var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
-                    reResult.ErrorMsg = HdlCheckLogic.Current.CheckGatewayErrorCode(temp.Error);
+                    listText.Add(text.Trim());
                 }
-                //濡傛灉鏄寚瀹氱殑涓婚
-                for (int i = 0; i < listReceiptTopic.Count; i++)
+                return listText;
+#endif
+#if Android
+                var stream = Application.Activity.Assets.Open("DeviceName.ini");
+                streamReader = new System.IO.StreamReader(stream, Encoding.UTF8);
+                string text;
+                while ((text = streamReader.ReadLine()) != null)
                 {
-                    if (topic == listReceiptTopic[i])
-                    {
-                        if (listCheckTopic.Contains(topic) == true)
-                        {
-                            //杩欓噷鍐欒繖涓笢瑗挎槸鏈夌偣鐢ㄥ鐨�
-                            continue;
-                        }
-                        string deviceMac = jobject["DeviceAddr"].ToString();
-                        int deviceEpoint = 200;
-                        if (jobject.Property("Epoint") != null)
-                        {
-                            //鎷ユ湁姝ら敭鍊�
-                            deviceEpoint = Convert.ToInt32(jobject["Epoint"].ToString());
-                        }
-                        if (device.DeviceAddr != deviceMac)
-                        {
-                            //涓嶆槸鍚屼竴涓笢瑗縈ac
-                            return;
-                        }
-                        if (device.DeviceEpoint != deviceEpoint && deviceEpoint != 200)
-                        {
-                            //涓嶆槸鍚屼竴涓笢瑗�,杩欓噷搴旇闇�瑕佺壒娈婂鐞�200绔偣
-                            return;
-                        }
-                        reResult.listReceiptData[i] = jobject["Data"].ToString();
-                        if (jobject.Property("Time") != null)
-                        {
-                            //闇�瑕佺Щ闄ime杩欎釜瀛楁
-                            jobject.Remove("Time");
-                        }
-                        reResult.JsonData[i] = jobject.ToString();
-                        if (listCheckTopic.Contains(topic) == false)
-                        {
-                            //鍔犲埌妫�娴嬩富棰樺璞′腑
-                            listCheckTopic.Add(topic);
-                        }
-                    }
+                    listText.Add(text.Trim());
                 }
-
-            };
-            myGateway.Actions += receiptAction;
-            //鍙戦�佹暟鎹�
-            myGateway.Send(sendTopic, sendData);
-
-            //瓒呮椂鏃堕棿
-            int TimeOut = 0;
-            waitTime = 20 * waitTime;
-            while (listCheckTopic.Count != listReceiptTopic.Count && TimeOut < waitTime)
-            {
-                //鍏ㄩ儴鎺ユ敹鎵嶉��鍑�
-                System.Threading.Thread.Sleep(50);
-                TimeOut++;
+                stream.Close();
+                return listText;
+#endif
             }
-            myGateway.Actions -= receiptAction;
-            receiptAction = null;
-            if (listCheckTopic.Count != listReceiptTopic.Count)
+            catch
             {
-                reResult.ErrorMsgDiv = 0;
+                return listText;
             }
-            else
+            finally
             {
-                //姝e父鎺ユ敹鍒扮綉鍏宠繑鍥炵殑鏁版嵁
-                if (reResult.listReceiptData.Length == 1)
+                try
                 {
-                    //濡傛灉鍙湁涓�涓富棰�,鍒欐浛鎹㈠彉閲�
-                    reResult.ReceiptData = reResult.listReceiptData[0];
+                    streamReader?.Close();
+                }
+                catch
+                {
                 }
             }
-
-            return reResult;
-        }
-
-        /// <summary>
-        /// 鍙戦�佹暟鎹埌缃戝叧锛屽苟鎺ュ彈缃戝叧杩斿洖鐨勬暟鎹�(閫忎紶涓撶敤)
-        /// </summary>
-        /// <param name="device">璁惧瀵硅薄</param>
-        /// <param name="sendData">闇�瑕佸彂閫佺殑鏁版嵁  JObject.ToString()鐨勪笢瑗�</param>
-        /// <param name="receiptCommand">鎸囧畾鎺ユ敹鍛戒护绗�</param>
-        /// <param name="receiptDataLength">鎸囧畾鎺ユ敹鏁版嵁鐨勯暱搴�</param>
-        /// <param name="waitTime">瓒呮椂鏃堕棿(绉�)</param>
-        /// <param name="listReceiptLength">闄勫姞妫�娴嬫暟鎹帴鏀堕暱搴�,褰撴帴鏀剁殑闀垮害鍦ㄨ繖鍒楄〃閲岄潰鏃�,浠h〃鎺ユ敹鎴愬姛(鏃ㄥ湪瀵瑰簲鏂版棫璁惧,閫忎紶鍥炲鐨勯暱搴﹀彲鑳戒笉鍚�)</param>
-        /// <returns>缃戝叧杩斿洖鐨勬暟鎹�</returns>
-        public ReceiptGatewayResult SendJobjectDataToGateway2(CommonDevice device, string sendData, string receiptCommand, int receiptDataLength,
-            int waitTime = 5, List<int> listReceiptLength = null)
-        {
-            var reResult = new ReceiptGatewayResult();
-            var myGateway = device.Gateway;
-            if (myGateway == null)
-            {
-                //鑾峰彇缃戝叧瀵硅薄澶辫触
-                reResult.ErrorMsg = Language.StringByID(R.MyInternationalizationString.uGetGatewayTagartFail);
-                reResult.ErrorMsgDiv = -1;
-                return reResult;
-            }
-            //缃戝叧ID
-            string gatewayID = device.Gateway.GwId;
-            //閿欒涓婚
-            string errorTopic = gatewayID + "/" + "Error_Respon";
-            //妫�娴嬪璞$殑涓婚
-            string checkTopic = gatewayID + "/ZbDataPassthrough";
-
-            Action<string, string> receiptAction = (topic, message) =>
-            {
-                var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
-
-                //缃戝叧鍥炲閿欒
-                if (topic == errorTopic)
-                {
-                    var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
-                    reResult.ErrorMsg = HdlCheckLogic.Current.CheckGatewayErrorCode(temp.Error);
-                }
-                //濡傛灉鏄寚瀹氱殑涓婚
-                if (topic == checkTopic)
-                {
-                    string deviceMac = jobject["DeviceAddr"].ToString();
-                    int deviceEpoint = 200;
-                    if (jobject.Property("Epoint") != null)
-                    {
-                        //鎷ユ湁姝ら敭鍊�
-                        deviceEpoint = Convert.ToInt32(jobject["Epoint"].ToString());
-                    }
-                    if (device.DeviceAddr != deviceMac)
-                    {
-                        //涓嶆槸鍚屼竴涓笢瑗縈ac
-                        return;
-                    }
-                    if (device.DeviceEpoint != deviceEpoint && deviceEpoint != 200)
-                    {
-                        //涓嶆槸鍚屼竴涓笢瑗�,杩欓噷搴旇闇�瑕佺壒娈婂鐞�200绔偣
-                        return;
-                    }
-
-                    var responseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClientDataPassthroughResponseData>(jobject["Data"].ToString());
-                    //闀垮害涓嶄竴鑷�
-                    if (responseData.PassData.Length != receiptDataLength)
-                    {
-                        if (listReceiptLength == null)
-                        {
-                            //濡傛灉娌℃湁闄勫姞妫�娴嬮暱搴�,鍒欑洿鎺ヨ繑鍥�
-                            return;
-                        }
-                        if (listReceiptLength.Contains(responseData.PassData.Length) == false)
-                        {
-                            //濡傛灉闄勫姞鐨勬娴嬮暱搴﹂噷闈�,杩樹笉瀛樺湪鐨勮瘽,鐩存帴杩斿洖
-                            return;
-                        }
-                    }
-
-                    var command = responseData.PassData[4].ToString()
-                        + responseData.PassData[5].ToString()
-                        + responseData.PassData[2].ToString()
-                        + responseData.PassData[3].ToString();
-                    //骞朵笖鏄繖涓懡浠�
-                    if (command == receiptCommand)
-                    {
-                        reResult.ReceiptData = responseData.PassData;
-                        reResult.JsonData = new string[1];
-                        if (jobject.Property("Time") != null)
-                        {
-                            //闇�瑕佺Щ闄ime杩欎釜瀛楁
-                            jobject.Remove("Time");
-                        }
-                        reResult.JsonData[0] = jobject.ToString();
-                    }
-                }
-            };
-            myGateway.Actions += receiptAction;
-            //鍙戦�佹暟鎹�
-            myGateway.Send("ClientDataPassthrough", sendData);
-
-            //瓒呮椂鏃堕棿
-            int TimeOut = 0;
-            waitTime = 20 * waitTime;
-            while (reResult.ReceiptData == null && TimeOut < waitTime)
-            {
-                System.Threading.Thread.Sleep(50);
-                TimeOut++;
-            }
-            myGateway.Actions -= receiptAction;
-            receiptAction = null;
-            if (reResult.ReceiptData == null)
-            {
-                //瓒呮椂
-                reResult.ErrorMsgDiv = 0;
-            }
-            return reResult;
         }
 
         #endregion
@@ -4190,9 +3759,33 @@
         /// </summary>
         IntelligentLocks_H06C = 2800,
         /// <summary>
-        /// S-one
+        /// S-One Pro
         /// </summary>
         IntelligentLocks_Sone = 2802,
+        /// <summary>
+        /// AT-1TF
+        /// </summary>
+        IntelligentLocks_AT1TF = 2803,
+        /// <summary>
+        /// AT-1F
+        /// </summary>
+        IntelligentLocks_AT1F = 2804,
+        /// <summary>
+        /// AT-1T
+        /// </summary>
+        IntelligentLocks_AT1T = 2805,
+        /// <summary>
+        /// HAT-1B
+        /// </summary>
+        IntelligentLocks_HAT1B = 2806,
+        /// <summary>
+        /// HAT-1T
+        /// </summary>
+        IntelligentLocks_HAT1T = 2807,
+        /// <summary>
+        /// AT-FT
+        /// </summary>
+        IntelligentLocks_ATFT = 2808,
 
         //=========鈽呪槄褰╃伅绫�(????-????)鈽呪槄=========
         /// <summary>
@@ -4247,6 +3840,18 @@
         /// zigbee杞琤uspro鍗忚杞崲鍣�
         /// </summary>
         Converter_ZbBuspro = 4201,
+
+        //=========鈽呪槄鏅捐。鏋剁被(5000-5199)鈽呪槄=========
+        /// <summary>
+        /// 鏅捐。鏋�
+        /// </summary>
+        Airer = 5000,
+
+        //=========鈽呪槄绌烘皵璐ㄩ噺浼犳劅鍣ㄧ被(5200-5399)鈽呪槄=========
+        /// <summary>
+        /// 绌烘皵璐ㄩ噺浼犳劅鍣�
+        /// </summary>
+        AirQualitySensor = 5200,
 
         //=========鈽呪槄鍏朵粬绫�(????-????)鈽呪槄=========
         /// <summary>
@@ -4325,6 +3930,14 @@
         /// </summary>
         A杞崲鍣� = 4200,
         /// <summary>
+        /// 鏅捐。鏋�(4200-4699)
+        /// </summary>
+        A鏅捐。鏋� = 5000,
+        /// <summary>
+        /// 绌烘皵璐ㄩ噺浼犳劅鍣�(5200-5399)
+        /// </summary>
+        A绌烘皵璐ㄩ噺 = 5200,
+        /// <summary>
         /// 褰╃伅
         /// </summary>
         A褰╃伅 = 9,

--
Gitblit v1.8.0