From fb49279fd0e36e1ed2bd7332eecee9f963c13649 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期日, 20 十二月 2020 19:33:29 +0800
Subject: [PATCH] 20201220-1

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

diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 386cc78..192d53b 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -231,7 +231,7 @@
                 {
                     roomNameList += ",";
                 }
-                roomNameList += findRoom.floorName + findRoom.roomName;
+                roomNameList += findRoom.floorName +"-"+ findRoom.roomName;
             }
             if (roomNameList == "" && functionType == FunctionType.Scene)
             {
@@ -286,19 +286,30 @@
             var sFunc = new SceneFunction();
             foreach (var attr in attributes)
             {
-                if (attr.curValue.ToString() == "{}")
+                switch (attr.key)
                 {
-                    attr.curValue = "0";
-                }
-                if (attr.key == FunctionAttributeKey.SetTemp)
-                {
-                    double vv = 16;
-                    Double.TryParse(attr.curValue.ToString(),out vv);
-                    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() });
+                    case FunctionAttributeKey.OnOff:
+                    case FunctionAttributeKey.Brightness:
+                    case FunctionAttributeKey.Mode:
+                    case FunctionAttributeKey.SetTemp:
+                    case FunctionAttributeKey.FanSpeed:
+                    case FunctionAttributeKey.Percent:
+                    case FunctionAttributeKey.FadeTime:
+                        if (attr.curValue.ToString() == "{}")
+                        {
+                            attr.curValue = "0";
+                        }
+                        if (attr.key == FunctionAttributeKey.SetTemp)
+                        {
+                            double vv = 16;
+                            Double.TryParse(attr.curValue.ToString(), out vv);
+                            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() });
+                        }
+                        break;
                 }
             }
             sFunc.sid = this.sid;

--
Gitblit v1.8.0