From dcf60777c9346ff058f06298d03173f0c53d1902 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 16 十二月 2020 20:42:15 +0800
Subject: [PATCH] 20201216-4

---
 HDL_ON/Entity/Function/Function.cs |   66 ++++++++++++---------------------
 1 files changed, 24 insertions(+), 42 deletions(-)

diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 0fb021f..d6d1e9b 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -149,37 +149,6 @@
         /// </summary>
         public int delay = 0;
         /// <summary>
-        /// 寤舵椂鏄剧ず鐨勬枃鏈�
-        /// </summary>
-        [Newtonsoft.Json.JsonIgnore]
-        public string delayText
-        {
-            get
-            {
-                string text = "";
-                switch (delay)
-                {
-                    case 0:
-                        text = Language.StringByID(StringId.NoDelay);
-                        break;
-                    case 30:
-                        text = "30s";
-                        break;
-                    case 60:
-                        text = "1min";
-                        break;
-                    case 120:
-                        text = "2min";
-                        break;
-                    case 300:
-                        text = "5min";
-                        break;
-                }
-                return text;
-            }
-        }
-
-        /// <summary>
         /// 鏈�鍚庢帶鍒剁殑涓�娆$姸鎬�
         /// </summary>
         [Newtonsoft.Json.JsonIgnore]
@@ -222,7 +191,8 @@
         /// <summary>
         /// 浣跨敤棰戠巼
         /// </summary>
-        public double usageFrequency {
+        public double usageFrequency
+        {
             get
             {
                 return usageCount / 7;
@@ -305,7 +275,7 @@
                 Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd);
             }
         }
-      
+
 
         /// <summary>
         /// 杞崲鎴愬満鏅姛鑳藉璞�
@@ -316,9 +286,17 @@
             var sFunc = new SceneFunction();
             foreach (var attr in attributes)
             {
-                sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString() });
-                sFunc.sid = this.sid;
+                if (attr.key == FunctionAttributeKey.SetTemp)
+                {
+                    var vv = Convert.ToDouble(attr.value);
+                    sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = Convert.ToInt32(vv).ToString() });
+                }
+                else
+                {
+                    sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString() });
+                }
             }
+            sFunc.sid = this.sid;
             return sFunc;
         }
 
@@ -455,11 +433,11 @@
         /// <summary>
         /// 鏈�澶у��
         /// </summary>
-        public int max=100;
+        public int max = 100;
         /// <summary>
         /// 鏈�灏忓��
         /// </summary>
-        public int min=0;
+        public int min = 0;
         /// <summary>
         /// 鏁版嵁绫诲瀷
         /// </summary>
@@ -486,7 +464,11 @@
         /// <summary>
         /// 棰滆壊
         /// </summary>
-        public const string Color = "color";
+        public const string RGB = "rgb";
+        /// <summary>
+        /// 娓愬彉鏃堕棿
+        /// </summary>
+        public const string FadeTime = "fade_time";
         /// <summary>
         /// 妯″紡
         /// </summary>
@@ -647,15 +629,15 @@
         /// <summary>
         /// 瀹剁數銆佹彃搴�
         /// </summary>
-        public const string ElectricSocket = "electric.socket ";
+        public const string ElectricSocket = "electrical.socket";
         /// <summary>
         /// 瀹剁數銆佺數瑙�
         /// </summary>
-        public const string ElectricTV = "electric.tv";
+        public const string ElectricTV = "electrical.tv";
         /// <summary>
         /// 瀹剁數銆侀鎵�
         /// </summary>
-        public const string ElectricFan = "electric.fan";
+        public const string ElectricFan = "electrical.fan";
     }
 
-}
+}
\ No newline at end of file

--
Gitblit v1.8.0