From 7d9e5d946d08f0b53ff25d1c25dcf83efb68b734 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 15 十二月 2020 09:08:59 +0800
Subject: [PATCH] 20201215-1

---
 HDL_ON/Entity/Function/FloorHeating.cs |   42 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/HDL_ON/Entity/Function/FloorHeating.cs b/HDL_ON/Entity/Function/FloorHeating.cs
index f4f8407..6c02ad6 100644
--- a/HDL_ON/Entity/Function/FloorHeating.cs
+++ b/HDL_ON/Entity/Function/FloorHeating.cs
@@ -6,11 +6,11 @@
     public class FloorHeating : Function
     {
         /*
-        *鍦扮儹锛歵rait: [switch, mode, set_temperature, lock]
+        *鍦扮儹锛歵rait: [switch, mode, set_temp, lock]
         *灞炴�� 鎻忚堪
         *switch	on/off
         *mode    day, night,away, vacation, timer
-        *set_temperature value(鍙)
+        *set_temp value
         *lock	boolean(Lock閿佸畾鎺у埗)
         *set_ point	up,down,value
         */
@@ -71,7 +71,10 @@
                             min = 0,
                         };
                     }
-                    _trait_mode.curValue = _trait_mode.value.Count > 0 ? _trait_mode.value[0] : "";
+                    if(_trait_mode.curValue.ToString() == "{}")
+                    {
+                        _trait_mode.curValue = "day";
+                    }
                 }
                 return _trait_mode;
             }
@@ -157,11 +160,35 @@
         /// </summary>
         public byte timeFlag = 0;
 
+        FunctionAttributes _trait_IndoorTemp;
         /// <summary>
         /// 瀹ゅ唴娓╁害
         /// </summary>
         [Newtonsoft.Json.JsonIgnore]
-        public int indoorTemp = 20;
+        public FunctionAttributes trait_IndoorTemp
+        {
+            get
+            {
+                if (_trait_IndoorTemp == null)
+                {
+                    _trait_IndoorTemp = attributes.Find((obj) => obj.key == FunctionAttributeKey.IndoorTemp);
+                    //鎵句笉鍒板睘鎬ч渶瑕佸0鏄庝竴涓紝闃叉鎶ラ敊闂��
+                    if (_trait_IndoorTemp == null)
+                    {
+                        _trait_IndoorTemp = new FunctionAttributes()
+                        {
+                            key = FunctionAttributeKey.IndoorTemp,
+                            value = new List<string> { },
+                            max = 30,
+                            min = 0,
+                        };
+                        if (_trait_IndoorTemp.curValue.ToString() == "{}")
+                            _trait_IndoorTemp.curValue = 0;
+                    }
+                }
+                return _trait_IndoorTemp;
+            }
+        }
 
 
         FunctionAttributes _trait_temp;
@@ -177,19 +204,20 @@
             {
                 if (_trait_temp == null)
                 {
-                    _trait_temp = attributes.Find((obj) => obj.key == "set_temperature");
+                    _trait_temp = attributes.Find((obj) => obj.key == "set_temp");
                     //鎵句笉鍒板睘鎬ч渶瑕佸0鏄庝竴涓紝闃叉鎶ラ敊闂��
                     if (_trait_temp == null)
                     {
                         _trait_temp = new FunctionAttributes()
                         {
-                            key = "set_temperature",
+                            key = "set_temp",
                             value = new List<string> { },
                             max = 30,
                             min = 5,
                         };
                     }
-                    _trait_temp.curValue = 16;
+                    if(_trait_temp.curValue.ToString() == "{}")
+                        _trait_temp.curValue = 16;
                 }
                 return _trait_temp;
             }

--
Gitblit v1.8.0