From 06696e6f225733a60b03eea4a7c6374053d92c1d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 14 四月 2020 14:15:35 +0800
Subject: [PATCH] 20200414

---
 HDL_ON/DriverLayer/Control.cs |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/HDL_ON/DriverLayer/Control.cs b/HDL_ON/DriverLayer/Control.cs
index cb7006d..960aaa7 100644
--- a/HDL_ON/DriverLayer/Control.cs
+++ b/HDL_ON/DriverLayer/Control.cs
@@ -23,6 +23,8 @@
         /// <returns></returns>
         public static void Send(CommandType_A commandType, Function function)
         {
+            function.usageCount++;
+            function.refreshTime = DateTime.Now;
             if (function.bus_Data!=null)
             {
                 try
@@ -185,9 +187,14 @@
                                         break;
                                 }
                                 break;
-                            case FunctionCategory.AC:
-                                var aC = function as AC;
-                                ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { aC.bus_Data.LoopID, (byte)aC.curTempType, 32, 32, 32, 32, 32, 0, aC.on_off == "on" ? (byte)1 : (byte)0, aC.curModeIndex, aC.curFanIndex, (byte)aC.curTemp, 0 });
+                            case FunctionCategory.Thermostat:
+                                switch (function.functionType)
+                                {
+                                    case FunctionType.AC:
+                                        var aC = function as AC;
+                                        ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { aC.bus_Data.LoopID, (byte)aC.curTempType, 32, 32, 32, 32, 32, 0, aC.on_off == "on" ? (byte)1 : (byte)0, aC.curModeIndex, aC.curFanIndex, (byte)aC.curTemp, 0 });
+                                        break;
+                                }
                                 break;
                         }
                         break;
@@ -216,8 +223,13 @@
                                         break;
                                 }
                                 break;
-                            case FunctionCategory.AC:
-                                ControlBytesSend(Command.ReadACMode, subnetId, deviceId, new byte[] {function.bus_Data.LoopID });
+                            case FunctionCategory.Thermostat:
+                                switch (function.functionType)
+                                {
+                                    case FunctionType.AC:
+                                        ControlBytesSend(Command.ReadACMode, subnetId, deviceId, new byte[] { function.bus_Data.LoopID });
+                                        break;
+                                }
                                 break;
                         }
                         break;

--
Gitblit v1.8.0