From 171bf03f3664226eeff2b20ee9bd2e914b63a17d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 13 三月 2020 09:18:50 +0800
Subject: [PATCH] 20200313

---
 HDL_ON/DriverLayer/Control.cs |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/DriverLayer/Control.cs b/HDL_ON/DriverLayer/Control.cs
index c696878..812afed 100644
--- a/HDL_ON/DriverLayer/Control.cs
+++ b/HDL_ON/DriverLayer/Control.cs
@@ -81,7 +81,13 @@
                         switch ((FunctionType)Enum.ToObject(typeof(FunctionType), Convert.ToInt32(functionType)))
                         {
                             case FunctionType.Light:
-                                if (jobj.ContainsKey("switch"))//缁х數鍣�
+                                if (jobj.ContainsKey("brightness"))
+                                {
+                                    var state = Convert.ToByte(jobj.GetValue("brightness"));
+                                    var bytes = new byte[] { Convert.ToByte(loopId), state, 0, 0 };
+                                    return ControlBytesSendHasReturn(Command.SetSingleLight, subnetId, deviceId, bytes);
+                                }
+                                else if (jobj.ContainsKey("switch"))//缁х數鍣�
                                 {
                                     var state = jobj.GetValue("switch").ToString() == "0" ? (byte)0 : (byte)100;
                                     var bytes = new byte[] { Convert.ToByte(loopId), state, 0, 0 };

--
Gitblit v1.8.0