From 1887ea937010ff8caba39622e8246a2802ca02c5 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 21 十二月 2020 19:40:04 +0800
Subject: [PATCH] 20201221-3

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
index d19d608..236032e 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -518,7 +518,8 @@
                                 {
                                     foreach (var dictionary in dicSateteList)
                                     {
-                                        if (dictionary["key"] == "on_off")
+                                        string keyValue = dictionary["key"];
+                                        if (keyValue == "on_off")
                                         {
                                             if (dictionary["value"] == "off")
                                             {
@@ -527,7 +528,7 @@
                                                 //閲嶆柊娣诲姞寮�鍏夊睘鎬ф暟鎹�
                                                 Dictionary<string, string> diction = new Dictionary<string, string>();
                                                 diction.Add("key", "on_off");
-                                                diction.Add("value", "on_off");
+                                                diction.Add("value", "off");
                                                 dicSateteList.Add(diction);
                                                 break;
                                             }
@@ -816,8 +817,30 @@
             #region 鐐瑰嚮浜嬩欢
             int brightnesValue = 0;
             Dictionary<string, string> dic = new Dictionary<string, string>();
-            LogicMethod.dictionary(dic, "key", "brightness");
-            string keyVlaue = "brightness";
+            string keyVlaue = "";
+
+            switch (device.functionType)
+            {
+                //寮�鍏崇伅鍏� light.Switch
+                case FunctionType.Dimmer:
+                case FunctionType.RGB:
+                case FunctionType.RGBW:
+                case FunctionType.ColorTemperature:
+                    {
+                        LogicMethod.dictionary(dic, "key", "brightness");
+                        keyVlaue = "brightness";
+                    }
+                    break;
+               
+                case FunctionType.MotorCurtain:
+                case FunctionType.RollingShutter:
+                    {
+                        LogicMethod.dictionary(dic, "key", "percent");
+                        keyVlaue = "percent";
+                    }
+                    break;
+            }
+            
             //鈥旂偣鍑讳簨浠�
             brightness.btn_subtract_click.MouseUpEventHandler += (sender2, e2) =>
             {
@@ -1006,7 +1029,7 @@
                                         }
                                     }
                                     break;
-                                case "brightness":
+                                case "percent":
                                     {
 
                                         button2.Text = value;

--
Gitblit v1.8.0