From 5de5a26d3825b3182a7d3a18ed1cbdbb78a3f9aa Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 23 七月 2020 16:39:59 +0800
Subject: [PATCH] 2020-07-23

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

diff --git a/HDL_ON/DriverLayer/Control.cs b/HDL_ON/DriverLayer/Control.cs
index b248598..5f6ad52 100644
--- a/HDL_ON/DriverLayer/Control.cs
+++ b/HDL_ON/DriverLayer/Control.cs
@@ -183,7 +183,14 @@
                                         {
                                             ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { curtain.bus_Data.LoopID, 0 });
                                         }
-                                        ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, (byte)curtain.openLevel });
+                                        else if (curtain.on_off == "on")
+                                        {
+                                            ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, 100 });
+                                        }
+                                        else if (curtain.on_off == "off")
+                                        {
+                                            ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { 17, 0 });
+                                        }
                                         break;
                                 }
                                 break;
@@ -292,6 +299,11 @@
                                         break;
                                 }
                                 break;
+                            case FunctionCategory.Sensor:
+                                var sensor = function as Sensor;
+                                ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { (byte)5,
+                                            (byte)((int)sensor.functionType % 256), sensor.bus_Data.LoopID });
+                                break;
                         }
                         break;
                 }

--
Gitblit v1.8.0