From 427a6e93b8946b9d91727166a352b2ee2ef75d19 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 05 二月 2021 10:10:08 +0800
Subject: [PATCH] Delete .DS_Store

---
 HDL_ON/Entity/Function/Function.cs |  207 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 172 insertions(+), 35 deletions(-)

diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
old mode 100644
new mode 100755
index a1db230..81bfa9d
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -1,4 +1,4 @@
-using System;
+锘縰sing System;
 using System.Collections.Generic;
 using HDL_ON.Common;
 using HDL_ON.DAL.Server;
@@ -70,39 +70,82 @@
         /// 璁惧spk
         /// </summary>
         public string spk = "";
-        /// <summary>
-        /// 鍔熻兘绫诲埆
-        /// 濡傦細绌鸿皟绫汇�佺伅鍏夌被銆佺獥甯樼被
-        /// </summary>
-        public FunctionCategory functionCategory
-        {
-            get
-            {
-                try
-                {
-                    var _functionCategoryString = sid.Substring(16, 2);
-                    var _functionCategory = Convert.ToInt32(_functionCategoryString, 16);
-                    return (FunctionCategory)Enum.ToObject(typeof(FunctionCategory), _functionCategory);
-                }
-                catch (Exception ex)
-                {
-                    MainPage.Log($"get FunctionCategory error : {ex.Message}");
-                    return FunctionCategory.UnKown;
-                }
-            }
-        }
+        ///// <summary>
+        ///// 鍔熻兘绫诲埆
+        ///// 濡傦細绌鸿皟绫汇�佺伅鍏夌被銆佺獥甯樼被
+        ///// </summary>
+        //public FunctionCategory Spk_Prefix
+        //{
+        //    get
+        //    {
+        //        try
+        //        {
+        //            var _functionCategoryString = sid.Substring(16, 2);
+        //            var _functionCategory = Convert.ToInt32(_functionCategoryString, 16);
+        //            return (FunctionCategory)Enum.ToObject(typeof(FunctionCategory), _functionCategory);
+        //        }
+        //        catch (Exception ex)
+        //        {
+        //            MainPage.Log($"get FunctionCategory error : {ex.Message}");
+        //            return FunctionCategory.UnKown;
+        //        }
+        //    }
+        //}
+
         ///// <summary>
         ///// 鍔熻兘绫诲瀷
         ///// </summary>
-        public FunctionType functionType
+        //public FunctionType spk
+        //{
+        //    get
+        //    {
+        //        var _functionTypeString = sid.Substring(16, 4);
+        //        return (FunctionType)Enum.ToObject(typeof(FunctionType), Convert.ToInt32(_functionTypeString, 16));
+        //    }
+        //}
+
+        string spk_Prefix;
+        /// <summary>
+        /// spk鍓嶇紑
+        /// 澶х被
+        /// 鍔熻兘绫诲埆
+        /// 濡傦細绌鸿皟绫汇�佺伅鍏夌被銆佺獥甯樼被
+        /// </summary>
+        public string Spk_Prefix
         {
             get
             {
-                var _functionTypeString = sid.Substring(16, 4);
-                return (FunctionType)Enum.ToObject(typeof(FunctionType), Convert.ToInt32(_functionTypeString, 16));
-
+                if (string.IsNullOrEmpty(spk_Prefix))
+                {
+                    spk_Prefix = spk.Split(".")[0];
+                }
+                return spk_Prefix;
             }
         }
+        string spk_Suffix;
+        ///// <summary>
+        ///// spk鍚庣紑
+        ///// 灏忕被
+        ///// 鍔熻兘绫诲瀷
+        ///// </summary>
+        //public string spk
+        //{
+        //    get
+        //    {
+        //        if (string.IsNullOrEmpty(spk_Suffix))
+        //        {
+        //            try
+        //            {
+        //                spk_Suffix = spk.Split(".")[1];
+        //            }
+        //            catch
+        //            {
+        //                spk_Suffix = "";
+        //            }
+        //        }
+        //        return spk_Suffix;
+        //    }
+        //}
 
         /// <summary>
         /// A鍗忚鍔熻兘鐨勭壒鎬�
@@ -178,16 +221,12 @@
                         _trait_on_off.curValue = "off";
                     }
                 }
-                if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off")
+                if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off" && _trait_on_off.curValue.ToString() != "stop")
                 {
                     _trait_on_off.curValue = "off";
                 }
                 return _trait_on_off;
             }
-            //set
-            //{
-            //    _trait_on_off = value;
-            //}
         }
 
         /// <summary>
@@ -299,7 +338,7 @@
                 }
                 roomNameList += findRoom.floorName +"-"+ findRoom.roomName;
             }
-            if (roomNameList == "" && functionType == FunctionType.Scene)
+            if (roomNameList == "" )
             {
                 roomNameList = Language.StringByID(StringId.WholeZone);
             }
@@ -350,6 +389,7 @@
         /// </summary>
         public void UpdataFuncitonInfo()
         {
+            new System.Threading.Thread(() =>
             {
                 var pm = new HttpServerRequest();
                 var pack = pm.UpdataDevcieInfo(this);
@@ -609,7 +649,19 @@
         /// 褰撳墠鍊�
         /// </summary>
         public object curValue = new object();
-
+        /// <summary>
+        /// curValue鐨勭炕璇戝��,鏈�鍧忕殑缁撴灉涔熷彧浼氳繑鍥瀞tring.Empty
+        /// </summary>
+        public string realValue
+        {
+            get
+            {
+                var myValue = curValue.ToString();
+                //娌欓洉瀹氫箟鐨刼bject绫诲瀷
+                if (myValue.Contains("{") == true) { return string.Empty; }
+                return myValue;
+            }
+        }
     }
     /// <summary>
     /// 鍔熻兘灞炴�ч敭鍚嶅垪琛�
@@ -797,10 +849,36 @@
         /// 婀垮害浼犳劅鍣�
         /// </summary>
         public const string SensorHumidity = "sensor.humidity";
+
+        /// <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 SensoruUtrasonic = "sensor.ultrasonic";
+
         /// <summary>
         /// 锛堝共鎺ョ偣锛�
         /// </summary>
-        public const string DryContact = "dryContact.standard";
+        public const string SensorDryContact = "sensor.dryContact";
         /// <summary>
         /// 瀹剁數銆佹彃搴�
         /// </summary>
@@ -812,7 +890,66 @@
         /// <summary>
         /// 瀹剁數銆侀鎵�
         /// </summary>
-        public const string ElectricFan = "electrical.fan";
+        public const string ElectricFan = "electrical.fan";
+        /// <summary>
+        /// 瀹剁數銆佹秱楦︾┖姘斿噣鍖栧櫒
+        /// </summary>
+        public const string ElectricTuyaAirCleaner = "electrical.Q1RsefNf91tIXyyQ";
+        /// <summary>
+        /// 瀹剁數銆佹秱楦︾數椋庢墖
+        /// </summary>
+        public const string ElectricTuyaFan = "electrical.tyqborgovyzytytz";
+        /// <summary>
+        /// 瀹剁數銆佹秱楦︽壂鍦版満鍣ㄤ汉
+        /// </summary>
+        public const string ElectricTuyaWeepRobot = "electrical.ai6HtccKFIw3dxo3";
     }
 
+
+    /// <summary>
+    /// 鍔熻兘绫诲埆
+    /// </summary>
+    public static class FunctionCategory
+    {
+        /// <summary>
+        ///锛堢伅锛�
+        /// </summary>
+        public const string Light = "light";
+        /// <summary>
+        /// 锛堢獥甯橈級
+        /// </summary>
+        public const string Curtain = "curtain";
+        /// <summary>
+        /// 锛堢┖璋冿級
+        /// </summary>
+        public const string AC = "ac";
+        /// <summary>
+        /// 锛堝湴鐑級
+        /// </summary>
+        public const string FloorHeat = "floorHeat";
+        /// <summary>
+        /// 锛堟柊椋庯級
+        /// </summary>
+        public const string AirFresh = "airFresh";
+        /// <summary>
+        /// 锛堥煶涔愶級
+        /// </summary>
+        public const string Music = "music";
+        /// <summary>
+        /// 锛堜紶鎰熷櫒锛�
+        /// </summary>
+        public const string Sensor = "sensor";
+        /// <summary>
+        /// 锛堝共鎺ョ偣锛�
+        /// </summary>
+        public const string DryContact = "dryContact";
+        /// <summary>
+        /// 瀹剁數
+        /// </summary>
+        public const string Electric = "electrical";
+
+        //Music = 0x09,
+    }
+
+
 }

--
Gitblit v1.8.0