From bfb3d0d4879dca8c59ff287c92f5113162f3a33a Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 27 八月 2024 15:22:48 +0800
Subject: [PATCH] 代码备份

---
 OnPro/HDL_ON/Entity/Function/Function.cs |  774 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 765 insertions(+), 9 deletions(-)

diff --git a/OnPro/HDL_ON/Entity/Function/Function.cs b/OnPro/HDL_ON/Entity/Function/Function.cs
index 658bd2f..d3fcbc8 100644
--- a/OnPro/HDL_ON/Entity/Function/Function.cs
+++ b/OnPro/HDL_ON/Entity/Function/Function.cs
@@ -108,6 +108,7 @@
         /// 鑾峰彇灞炴�у綋鍓嶇姸鎬�
         /// </summary>
         /// <param name="key"></param>
+        /// <param name="defaultValue">榛樿鍊�</param>
         /// <returns></returns>
         public string GetAttrState(string key, string defaultValue = "0")
         {
@@ -120,7 +121,7 @@
             if (string.IsNullOrEmpty(attrState.state))
             {
                 //浜岀骇鏌ヨkeyValue鍊�
-                return GetOriginalState(key);
+                return GetOriginalState(key, defaultValue);
             }
             return attrState.state;
         }
@@ -130,13 +131,14 @@
         /// 榛樿鍊硷細0
         /// </summary>
         /// <param name="key">璇泙瀹氫箟鐨勫睘鎬у��</param>
+        /// <param name="defaultValue">榛樿鍊�</param>
         /// <returns></returns>
-        public string GetOriginalState(string key)
+        public string GetOriginalState(string key, string defaultValue)
         {
             var originalState = status.Find((s) => s.key == key.ToString());
             if (originalState == null || string.IsNullOrEmpty(originalState.value))
             {
-                return "0";
+                return defaultValue;
             }
             return originalState.value;
         }
@@ -171,6 +173,25 @@
                 string iconPath = spk.Replace(".", "");
                 switch (spk)
                 {
+                    case SPK.SensorDryContact2:
+                    case SPK.OtherCommon:
+                        iconPath = "sensordryContact";
+                        break;
+                    //case SPK.SensorLight:
+                    //    iconPath = "lightswitch";
+                    //    break;
+                    case SPK.AirSwitchP3:
+                        iconPath = "electricalbreaker";
+                        break;
+                    case SPK.PanelSocket:
+                        iconPath = "electricalsocket";
+                        break;
+                    case SPK.SenesorMegahealth2:
+                        iconPath = "sensormegahealth";
+                        break;
+                    case SPK.SensorEnvironmentHailin:
+                        iconPath = "sensorenvironment";
+                        break;
                     case SPK.HvacAirFresh:
                         iconPath = "airFreshstandard";
                         break;
@@ -180,8 +201,26 @@
                     case SPK.HvacAC:
                         iconPath = "acstandard";
                         break;
+                    case SPK.HvacFan:
+                        iconPath = "electricalfan";
+                        break;
                     case SPK.HvacFloorHeat:
                         iconPath = "floorHeatstandard";
+                        break;
+                    case SPK.ElectricTuyaFan2:
+                        iconPath = "electricaltyqborgovyzytytz";
+                        break;
+                    case SPK.ElectricTuyaAirCleaner2:
+                        iconPath = "electricalQ1RsefNf91tIXyyQ";
+                        break;
+                    case SPK.ElectricTuyaWaterValve2:
+                        iconPath = "electricalkoiGhMKwLf2ZP81g";
+                        break;
+                    case SPK.ElectricTuyaWeepRobot2:
+                        iconPath = "electricalai6HtccKFIw3dxo3";
+                        break;
+                    case SPK.AvMusic:
+                        iconPath = "musicstandard";
                         break;
 
                 }
@@ -319,6 +358,26 @@
         }
 
 
+        //string spk_Prefix;
+        ///// <summary>
+        ///// spk鍓嶇紑
+        ///// 澶х被
+        ///// 鍔熻兘绫诲埆
+        ///// 濡傦細绌鸿皟绫汇�佺伅鍏夌被銆佺獥甯樼被
+        ///// </summary>
+        //public string Spk_Prefix
+        //{
+        //    get
+        //    {
+        //        if (string.IsNullOrEmpty(spk_Prefix))
+        //        {
+        //            spk_Prefix = spk.Split(".")[0];
+        //        }
+        //        return spk_Prefix;
+        //    }
+        //}
+
+
         /// <summary>
         /// A鍗忚鍔熻兘鐨勭壒鎬�
         /// 濡傦細鏄疉C鍔熻兘锛氱壒鎬э細on_off,mode,fan,temperature
@@ -328,7 +387,7 @@
 
         public List<FunctionAttributes> GetFunctionAttributes()
         {
-            return attributes;
+                return attributes;
         }
 
 
@@ -372,6 +431,10 @@
         public bool online {
             get
             {
+                if (spk == SPK.AirSwitchP3|| spk == SPK.ElectricalTvHisense)
+                {
+                    return _online;
+                }
                 return true;
             }
             set
@@ -400,6 +463,10 @@
 
         public bool isOnline()
         {
+            if (spk == SPK.AirSwitchP3)
+            {
+                return online;
+            }
             return true;
         }
 
@@ -448,6 +515,22 @@
         public string GetLastStateText()
         {
             var text = "";
+            switch (spk)
+            {
+                case SPK.HvacCac:
+                    switch (GetAttrState(FunctionAttributeKey.Mode))
+                    {
+                        case "cool":
+                            text = Language.StringByID(StringId.Cool);
+                            break;
+                        case "heat":
+                            text = Language.StringByID(StringId.Heat);
+                            break;
+                    }
+
+                    break;
+                    
+            }
             return text;
         }
 
@@ -532,13 +615,19 @@
 
             new System.Threading.Thread(() =>
             {
-                if (collect)
-                {
-                    result = ApiUtlis.Ins.HttpRequest.CollectDevice(deviceId).Code;
+                if (spk == SPK.GroupControl) {
+                   
                 }
                 else
                 {
-                    result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code;
+                    if (collect)
+                    {
+                        result = ApiUtlis.Ins.HttpRequest.CollectDevice(deviceId).Code;
+                    }
+                    else
+                    {
+                        result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code;
+                    }
                 }
                 //鎻愮ず閿欒
                 if (result != StateCode.SUCCESS)
@@ -721,12 +810,59 @@
             var sFunc = new SceneFunction();
 
             var list = new List<FunctionAttributes>();
+            if (spk == SPK.GroupControl)
+            {
+            }
+            else if (spk == SPK.MusicStandard || spk == SPK.AvMusic)
+            {
+                list.Add(new FunctionAttributes
+                {
+                    key = FunctionAttributeKey.OnOff,
+                    curValue = string.Empty,
+                });
+                list.Add(new FunctionAttributes
+                {
+                    key = FunctionAttributeKey.Volume,
+                    curValue = string.Empty,
+                });
+                list.Add(new FunctionAttributes
+                {
+                    key = FunctionAttributeKey.SongName,
+                    curValue = string.Empty,
+                });
+
+            }
+            else if (spk == SPK.ElectricalTvHisense)
+            {
+                list.Add(new FunctionAttributes
+                {
+                    key = FunctionAttributeKey.OnOff,
+                    curValue = string.Empty,
+                });
+                list.Add(new FunctionAttributes
+                {
+                    key = FunctionAttributeKey.SetVolume,
+                    curValue = string.Empty,
+                });
+                list.Add(new FunctionAttributes
+                {
+                    key = FunctionAttributeKey.Signal,
+                    curValue = string.Empty,
+                });
+            }
+            else
+            {
                 list.AddRange(attributes);
+            }
 
             foreach (var attr in list)
             {
+                if(attr.key == FunctionAttributeKey.ColorfulBegin || attr.key == FunctionAttributeKey.ColorfulEnd || attr.key == FunctionAttributeKey.ColorfulTime)
+                {
+                    continue;
+                }
                 //绐楀笜鍚屾椂鍙戦�佸紑鍏宠窡鐧惧垎姣斾細鏈夐棶棰橈紝
-                if (spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex || spk == SPK.CurtainDream)
+                if(spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex || spk == SPK.CurtainDream)
                 {
                     if (attr.key == FunctionAttributeKey.OnOff)
                     {
@@ -735,6 +871,9 @@
                             continue;
                         }
                     }
+                }else if (spk == SPK.GroupControl)
+                {
+                    sFunc.type = "5";
                 }
 
                 switch (attr.key)
@@ -791,6 +930,10 @@
 
                 switch (attr.key)
                 {
+                    case FunctionAttributeKey.SongName:
+                    case FunctionAttributeKey.Volume:
+                    case FunctionAttributeKey.SetVolume:
+                    case FunctionAttributeKey.Signal:
                     case FunctionAttributeKey.OnOff:
                     case FunctionAttributeKey.Brightness:
                     case FunctionAttributeKey.Mode:
@@ -868,6 +1011,11 @@
         /// 鏇存柊鏃堕棿
         /// </summary>
         public DateTime refreshTime = DateTime.MinValue;
+        /// <summary>
+        /// 鏈�鍚庢洿鏂扮姸鎬佺殑鏃堕棿
+        /// </summary>
+        [Newtonsoft.Json.JsonIgnore]
+        public DateTime updateTime = DateTime.MinValue;
 
         /// <summary>
         /// 鑾峰彇鏈湴鎺у埗鏁版嵁
@@ -1290,6 +1438,10 @@
         public const string Temperature = "temperature";
         public const string Hcho = "hcho";
         public const string Humidity = "humidity";
+        /// <summary>
+        /// 鐓у害
+        /// </summary>
+        public const string Illuminance = "illuminance";
         public const string Pm25 = "pm25";
         public const string Tvoc = "tvoc";
         /// <summary>
@@ -1428,6 +1580,32 @@
         /// </summary>
         public const string TotalElectricity = "total_electricity";
 
+        /// <summary>
+        /// 娴蜂俊tv闊抽噺
+        /// </summary>
+        public const string SetVolume = "set_volume";
+        /// <summary>
+        /// 娴蜂俊tv淇″彿婧�(0:LiveTV;2:PS;3:HDMI_1;4:HDMI_2;5:HDMI_3;6:HDMI_4;11:AV;)
+        /// </summary>
+        public const string Signal = "signal";
+
+        /// <summary>
+        /// 闊充箰闊抽噺
+        /// </summary>
+        public const string Volume = "volume";
+        /// <summary>
+        /// 姝屾洸鍚�
+        /// </summary>
+        public const string SongName = "song_name";
+        /// <summary>
+        /// 鍒楄〃鍚�
+        /// </summary>
+        public const string PlaylistName = "playlist_name";
+        /// <summary>
+        /// 鎾斁璺緞
+        /// </summary>
+        public const string Url = "url";
+
 
     }
     /// <summary>
@@ -1486,6 +1664,112 @@
     /// </summary>
     public static class SPK
     {
+        /// <summary>
+        /// 缇ゆ帶锛堣嚜瀹氫箟锛�
+        /// </summary>
+        public const string GroupControl = "groupControl";
+        /// <summary>
+        /// 閫氱敤寮�鍏�
+        /// </summary>
+        public const string OtherCommon = "other.common";
+        /// <summary>
+        /// 搴忓垪
+        /// </summary>
+        public const string CommonSeries = "other.series";
+        /// <summary>
+        /// 澶у崕鎽勫儚澶�
+        /// </summary>
+        public const string IpCam_Imou = "security.ipcam.imou";
+        /// <summary>
+        /// 鏈烘鎵�
+        /// </summary>
+        public const string MechanicalArm = "electrical.mechanical_arm";
+        /// <summary>
+        /// 绌鸿皟绉戞妧绯荤粺锛堢豢寤猴級
+        /// 鎬绘帶
+        /// </summary>
+        public const string AcstParent = "acst.parent";
+        /// <summary>
+        /// 绌鸿皟绉戞妧绯荤粺锛堢豢寤猴級
+        /// 瀛愭帶
+        /// </summary>
+        public const string AcstSub = "acst.sub";
+
+        /// <summary>
+        /// 闂ㄩ攣
+        /// </summary>
+        public const string DoorLock = "security.door";
+        
+        /// <summary>
+        /// 闂ㄩ攣spk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> GetDoorLockSPKList()
+        {
+            var list = new List<string>();
+            list.Add(DoorLock);
+            return list;
+        }
+        
+
+        /// <summary>
+        /// 鐚溂(鏃pk)
+        /// </summary>
+        public const string Peephole = "peephole";
+
+        /// <summary>
+        /// 鐚溂(鏂皊pk 鏆傛椂娌$敤)
+        /// </summary>
+        //public const string PeepholeEz = "security.peephole.ez";
+        /// <summary>
+        /// 钀ょ煶瑙嗛闂ㄩ攣
+        /// </summary>
+        public const string VideoDoorLock="security.door.ezviz";
+        /// <summary>
+        /// 钀ょ煶鎽勫儚澶�
+        /// </summary>
+        public const string Ev_Ipcam = "security.ipcam.ez";
+        /// <summary>
+        /// 褰遍煶涓帶
+        /// </summary>
+        public const string AvZkAiks = "av.zk.aiks";
+       
+        /// <summary>
+        /// 钀ょ煶瑙嗛闂ㄩ攣spk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> GetVideoDoorLockSPKList()
+        {
+            var list = new List<string>();
+            list.Add(VideoDoorLock);
+            return list;
+        }
+
+      
+        /// <summary>
+        /// 褰遍煶涓帶spk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> GetVideoControlsSPKList()
+        {
+            var list = new List<string>
+            {
+                AvZkAiks
+            };
+            return list;
+        }
+
+        /// <summary>
+        /// 钀ょ煶鎽勫儚澶磗pk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> GetEvIpcamSPKList()
+        {
+            var list = new List<string>();
+            list.Add(Ev_Ipcam);
+            return list;
+        }
+
         #region 鐏厜
         /// <summary>
         /// 锛堝紑鍏崇伅锛�
@@ -1575,6 +1859,10 @@
         /// 绌鸿皟
         /// </summary>
         public const string HvacAC = "hvac.ac";
+        /// <summary>
+        /// 姣涚粏绠$┖璋�
+        /// </summaryc
+        public const string HvacCac = "hvac.cac";
 
         /// <summary>
         /// 绌鸿皟spk鍒楄〃
@@ -1586,6 +1874,7 @@
             spkList.Add(AcStandard);
             spkList.Add(HvacAC);
             spkList.Add(AcIr);
+            spkList.Add(HvacCac);
             return spkList;
         }
         #endregion
@@ -1646,6 +1935,473 @@
         }
         #endregion
 
+        #region 鑳芥簮
+        /// <summary>
+        /// 閫嗗彉鍣�
+        /// </summary>
+        public const string Inverter = "energy.inverter";
+        /// <summary>
+        /// 涓夌浉閫嗗彉鍣�
+        /// </summary>
+        public const string InverterRst = "energy.inverter_rst";
+        /// <summary>
+        /// 鑳芥簮妯″潡
+        /// </summary>
+        public const string EnergyStandard = "energy.standard";
+
+        /// <summary>
+        /// 鑳芥簮-鐢佃兘
+        /// </summary>
+        public const string ElectricEnergy = "energy.electric";
+        /// <summary>
+        /// 鑳芥簮spk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> EnergySpkList()
+        {
+            var spkList = new List<string>();
+            spkList.Add(ElectricEnergy);
+            spkList.Add(AirSwitch);
+            spkList.Add(AirSwitchP3);
+            return spkList;
+        }
+        #endregion
+
+        #region 闊充箰
+        /// <summary>
+        /// 锛堥煶涔愶級
+        /// </summary>
+        public const string MusicStandard = "music.standard";
+        /// <summary>
+        /// 闊充箰
+        /// </summary>
+        public const string AvMusic = "av.music";
+
+        /// <summary>
+        /// 闊充箰spk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> MusicSpkList()
+        {
+            var spkList = new List<string>();
+            spkList.Add(MusicStandard);
+            spkList.Add(AvMusic);
+            return spkList;
+        }
+        #endregion
+
+        #region 浼犳劅鍣�
+
+        #region 瀹夐槻浼犳劅鍣�
+        /// <summary>
+        /// 锛堜寒搴︿紶鎰熷櫒锛�
+        /// </summary>
+        public const string SensorLight = "sensor.light";
+        /// <summary>
+        /// (绾㈠绉诲姩浼犳劅鍣�)
+        /// </summary>
+        public const string SensorPir = "sensor.pir";
+        /// <summary>
+        /// 浜轰綋瀛樺湪浼犳劅鍣�
+        /// </summary>
+        public const string SensorPirHold = "sensor.pir_hold";
+        /// <summary>
+        /// 锛堥棬绐椾紶鎰熷櫒锛�
+        /// </summary>
+        public const string SensorDoorWindow = "sensor.doorwindow";
+        /// <summary>
+        /// 鐑熼浘浼犳劅鍣�
+        /// </summary>
+        public const string SensorSmoke = "sensor.smoke";
+        /// <summary>
+        /// 姘存蹈浼犳劅鍣�
+        /// </summary>
+        public const string SensorWater = "sensor.water";
+        /// <summary>
+        /// 鐕冩皵浼犳劅鍣�
+        /// </summary>
+        public const string SensorGas = "sensor.gas";
+        /// <summary>
+        /// 绾㈠鐝婃爮浼犳劅鍣�      
+        /// </summary>
+        public const string SensorShanLan = "sensor.shanlan";
+        /// <summary>
+        /// 绾㈠瀵瑰皠浼犳劅鍣�
+        /// </summary>
+        public const string SensorDuiShe = "sensor.duishe";
+        /// <summary>
+        /// 瓒呭0娉紶鎰熷櫒
+        /// </summary>
+        public const string SensorUtrasonic = "sensor.ultrasonic";
+        /// <summary>
+        /// 锛堝共鎺ョ偣锛�
+        /// </summary>
+        public const string SensorDryContact = "sensor.dryContact";
+        public const string SensorDryContact2 = "dryContact.standard";
+        /// <summary>
+        /// 姣背娉紶鎰熷櫒
+        /// </summary>
+        public const string SenesorMegahealth = "sensor.megahealth";
+        public const string SenesorMegahealth2 = "sensor.megahealth.zg";
+        /// <summary>
+        /// 姣背娉紶鎰熷櫒锛堝Э鎬佺増锛�
+        /// </summary>
+        public const string SensorMmvPose = "sensor.mmv_pose";
+        /// <summary>
+        /// 绱ф�ュ懠鍙�
+        /// </summary>
+        public const string SensorHelp = "sensor.help";
+        /// <summary>
+        /// 瀹夐槻浼犳劅鍣╯pk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> ArmSensorSpkList()
+        {
+            var spkList = new List<string>();
+            //spkList.Add(SensorLight);
+            spkList.Add(SensorPir);
+            spkList.Add(SensorPirHold);
+            spkList.Add(SensorHelp);
+            spkList.Add(SensorDoorWindow);
+            spkList.Add(SensorSmoke);
+            spkList.Add(SensorWater);
+            spkList.Add(SensorGas);
+            //spkList.Add(SensorShanLan);
+            //spkList.Add(SensorDuiShe);
+            //spkList.Add(SensoruUtrasonic);
+            spkList.Add(SensorDryContact);
+            spkList.Add(SensorDryContact2);
+            spkList.Add(SenesorMegahealth);
+            spkList.Add(SenesorMegahealth2);
+            spkList.Add(SensorMmvPose);
+            return spkList;
+        }
+        #endregion
+
+        public const string PanelEnvironment = "screen.panel";
+        /// <summary>
+        /// 闈㈡澘spk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> PanelSpkList()
+        {
+            var spkList = new List<string>();
+            spkList.Add(SensorHelp);
+            spkList.Add(PanelEnvironment);
+            return spkList;
+        }
+
+        #region 鐜浼犳劅鍣�
+        /// <summary>
+        /// 锛圥M10浼犳劅鍣級
+        /// </summary>
+        public const string SensorPm10 = "sensor.pm10";
+        /// <summary>
+        /// 锛堟俯搴︿紶鎰熷櫒锛�
+        /// </summary>
+        public const string SensorTemperature = "sensor.temperature";
+        /// <summary>
+        /// 锛圥M2.5浼犳劅鍣級
+        /// </summary>
+        public const string SensorPm25 = "sensor.pm25";
+        /// <summary>
+        /// co2浼犳劅鍣�
+        /// </summary>
+        public const string SensorCO2 = "sensor.co2";
+        /// <summary>
+        /// tvoc浼犳劅鍣�
+        /// </summary>
+        public const string SensorTVOC = "sensor.tvoc";
+        /// <summary>
+        /// 婀垮害浼犳劅鍣�
+        /// </summary>
+        public const string SensorHumidity = "sensor.humidity";
+        /// <summary>
+        /// 鐜浼犳劅鍣�
+        /// 鐜妫�娴嬩紶鎰熷櫒
+        /// 鐗规畩绫籹pk
+        /// 璇pk鍔熻兘鏄幆澧冧紶鎰熷櫒鍔熻兘鐨勯泦鎴�
+        /// </summary>
+        public const string SensorEnvironment = "sensor.environment";
+        /// <summary>
+        /// 闈掕悕鐜浼犳劅鍣�
+        /// </summary>
+        public const string SensorEnvironment2 = "sensor.environment2";
+        /// <summary>
+        /// 闈掕悕鐜浼犳劅鍣�
+        /// </summary>
+        public const string SensorEnvironment3 = "sensor.environment3";
+        public const string SensorEnvironmentHailin = "sensor.environment.hailin";
+        /// <summary>
+        /// 鐢查啗
+        /// </summary>
+        public const string SensorHcho = "sensor.hcho";
+
+        /// <summary>
+        /// 鐜浼犳劅鍣ㄨ澶噑pk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> EnvironDeviceSpkList()
+        {
+            var spkList = new List<string>();
+            spkList.Add(SensorTemperature);
+            spkList.Add(SensorPm10);
+            spkList.Add(SensorPm25);
+            spkList.Add(SensorCO2);
+            spkList.Add(SensorTVOC);
+            spkList.Add(SensorHumidity);
+            spkList.Add(SensorEnvironment); spkList.Add(SensorEnvironmentHailin);
+            spkList.Add(SensorEnvironment2);
+            spkList.Add(SensorEnvironment3);
+            spkList.Add(SensorHcho);
+            spkList.Add(SensorLight);
+            return spkList;
+        }
+        /// <summary>
+        /// 鐜浼犳劅鍣╯pk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> EnvironSpkList()
+        {
+            var spkList = new List<string>();
+            spkList.Add(SensorTemperature);
+            spkList.Add(SensorPm10);
+            spkList.Add(SensorPm25);
+            spkList.Add(SensorCO2);
+            spkList.Add(SensorTVOC);
+            spkList.Add(SensorHumidity);
+            spkList.Add(SensorHcho);
+            spkList.Add(SensorLight);
+            return spkList;
+        }
+
+        /// <summary>
+        /// 鐜浼犳劅鍣ㄨ澶囧垪琛�
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> EvironmentSensorList()
+        {
+            var spkList = new List<string>();
+            spkList.Add(SensorEnvironment); spkList.Add(SensorEnvironmentHailin);
+            spkList.Add(SensorEnvironment2);
+            spkList.Add(SensorEnvironment3);
+         
+            return spkList;
+        }
+
+        #endregion
+        #endregion
+
+        #region 瀹剁數
+        /// <summary>
+        /// 娴蜂俊鐢佃
+        /// </summary>
+        public const string ElectricalTvHisense = "electrical.tv.hisense";
+        /// <summary>
+        /// 瀹剁數銆佹彃搴�
+        /// </summary>
+        public const string ElectricSocket = "electrical.socket";
+        /// <summary>
+        /// 闈㈡澘銆佹彃搴с�侀潰鏉�
+        /// </summary>
+        public const string PanelSocket = "panel.socket";
+        /// <summary>
+        /// 瀹剁數銆佺數瑙�
+        /// </summary>
+        public const string ElectricTV = "electrical.tv";
+        /// <summary>
+        /// 绾㈠銆佺數瑙�
+        /// </summary>
+        public const string TvIr = "ir.tv";
+        /// <summary>
+        /// 绾㈠銆佸皬绫崇數瑙�
+        /// </summary>
+        public const string TvXmIr = "ir.tvxm";
+        /// <summary>
+        /// 瀹剁數銆侀鎵�
+        /// </summary>
+        public const string ElectricFan = "electrical.fan";
+        public const string HvacFan = "hvac.fan";
+        /// <summary>
+        /// 鍑夐湼
+        /// </summary>
+        public const string ClothesHanger = "electrical.racks";
+        /// <summary>
+        /// 绾㈠閬ユ帶鍣�
+        /// </summary>
+        public const string IrLearn = "ir.learn";
+        /// <summary>
+        /// 绾㈠鎶曞奖浠�
+        /// </summary>
+        public const string PjtIr = "ir.pjt";
+        /// <summary>
+        /// 绾㈠鏈洪《鐩�
+        /// </summary>
+        public const string StbIr = "ir.stb";
+        /// <summary>
+        /// 绾㈠褰辩鏈�
+        /// </summary>
+        public const string DvDIr = "ir.dvd";
+        /// <summary>
+        /// 绾㈠绌烘皵鍑�鍖栧櫒
+        /// </summary>
+        public const string PurifierIr = "ir.air_purifier";
+        /// <summary>
+        /// 绾㈠鐑按鍣�
+        /// </summary>
+        public const string HeaterIr = " ir.water_heater";
+        /// <summary>
+        /// 绾㈠椋庢墖
+        /// </summary>
+        public const string FanIr = "ir.fan";
+        /// <summary>
+        /// 鏅鸿兘绌哄紑
+        /// </summary>
+        public const string AirSwitch = "electrical.breaker";
+        /// <summary>
+        /// 涓夌浉鏅鸿兘绌哄紑
+        /// </summary>
+        public const string AirSwitchP3 = "electrical.breakerP3";
+
+        #region 娑傞甫
+        /// <summary>
+        /// 瀹剁數銆佹秱楦︾┖姘斿噣鍖栧櫒
+        /// </summary>
+        public const string ElectricTuyaAirCleaner = "electrical.Q1RsefNf91tIXyyQ";
+        public const string ElectricTuyaAirCleaner2 = "hvac.air.tuya_epi345";
+        /// <summary>
+        /// 瀹剁數銆佹秱楦︾數椋庢墖
+        /// </summary>
+        public const string ElectricTuyaFan = "electrical.tyqborgovyzytytz";
+        public const string ElectricTuyaFan2 = "hvac.fan.tuya_ef101";
+        /// <summary>
+        /// 瀹剁數銆佹秱楦︽壂鍦版満鍣ㄤ汉
+        /// </summary>
+        public const string ElectricTuyaWeepRobot = "electrical.ai6HtccKFIw3dxo3";
+        public const string ElectricTuyaWeepRobot2 = "electrical.sweep.tuya";
+        /// <summary>
+        /// 瀹剁數銆佹秱楦︽按闃�
+        /// </summary>
+        public const string ElectricTuyaWaterValve = "electrical.koiGhMKwLf2ZP81g";
+        public const string ElectricTuyaWaterValve2 = "electrical.watervalve.tuya_aw713";
+        #endregion
+
+
+        /// <summary>
+        /// 瀹剁數spk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> ElectricalSpkList()
+        {
+            var spkList = new List<string>();
+            spkList.Add(ElectricSocket);
+            spkList.Add(PanelSocket);
+            spkList.Add(ElectricTV);
+            spkList.Add(TvIr);
+            spkList.Add(TvXmIr);
+            spkList.Add(ElectricFan);
+            spkList.Add(HvacFan);
+            spkList.Add(FanIr);
+            spkList.Add(ClothesHanger);
+            spkList.Add(IrLearn);
+            spkList.Add(PjtIr);
+            spkList.Add(StbIr);
+            spkList.Add(ElectricTuyaAirCleaner);
+            spkList.Add(ElectricTuyaAirCleaner2);
+            spkList.Add(ElectricTuyaFan);
+            spkList.Add(ElectricTuyaFan2);
+            spkList.Add(ElectricTuyaWeepRobot);
+            spkList.Add(ElectricTuyaWeepRobot2);
+            spkList.Add(ElectricTuyaWaterValve);
+            spkList.Add(ElectricTuyaWaterValve2);
+            spkList.Add(AirSwitch);
+            spkList.Add(ElectricalTvHisense);
+            return spkList;
+        }
+
+
+        #endregion
+
+        #region 璁惧绫�
+        /// <summary>
+        /// 绾㈠瀹�
+        /// </summary>
+        public const string IrModule = "ir.module";
+
+        /// <summary>
+        /// 璁惧绫籹pk鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> DeviceSpkList()
+        {
+            var spkList = new List<string>();
+            spkList.Add(IrModule);
+            return spkList;
+        }
+        #endregion
+
+        #region 鍙瀵硅
+        /// <summary>
+        /// HDL鍙瀵硅
+        /// </summary>
+        public const string doorgate="door.gate";
+        #endregion
+
+        #region 绗笁鏂箂pk鍒楄〃
+        /// <summary>
+        /// 鑾峰彇鎵�鏈夌涓夋柟鍝佺墝鍔熻兘鐨剆pk
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> GetAll3tySPK()
+        {
+            var spkList = new List<string>();
+            spkList.Add(ElectricTuyaAirCleaner);
+            spkList.Add(ElectricTuyaAirCleaner2);
+            spkList.Add(ElectricTuyaFan);
+            spkList.Add(ElectricTuyaFan2);
+            spkList.Add(ElectricTuyaWaterValve);
+            spkList.Add(ElectricTuyaWaterValve2);
+            spkList.Add(ElectricTuyaWeepRobot);
+            spkList.Add(ElectricTuyaWeepRobot2);
+            spkList.Add(SensorMmvPose);
+            spkList.Add(SenesorMegahealth);
+            spkList.Add(SenesorMegahealth2);
+            return spkList;
+        }
+        /// <summary>
+        /// 鑾峰彇绗笁鏂硅澶噑pk
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> Get3tySpk(BrandType brandType)
+        {
+            var list = new List<string>();
+
+            switch (brandType)
+            {
+                case BrandType.Tuya:
+                    list.Add(ElectricTuyaAirCleaner);
+                    list.Add(ElectricTuyaFan);
+                    list.Add(ElectricTuyaWaterValve);
+                    list.Add(ElectricTuyaWeepRobot);
+                    list.Add(ElectricTuyaAirCleaner2);
+                    list.Add(ElectricTuyaFan2);
+                    list.Add(ElectricTuyaWaterValve2);
+                    list.Add(ElectricTuyaWeepRobot2);
+                    break;
+                case BrandType.All3tyBrand:
+                    list.Add(SenesorMegahealth2);//鍏嗚
+                    break;
+            }
+            return list;
+        }
+        #endregion
+
+        /// <summary>
+        /// 娌℃湁鐘舵�佹樉绀虹殑鍔熻兘spk鍒楄〃
+        /// </summary>
+        public static List<string> NotStatusSpkList = new List<string> {
+            ElectricTV, FanIr, TvIr, TvXmIr, StbIr, PjtIr, IrLearn
+        };
 
         /// <summary>
         /// 绗笁鏂瑰搧鐗屽垪琛�

--
Gitblit v1.8.0