From bee7814dba8e033d0f36060926275b90c85c779c Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期三, 06 九月 2023 14:39:57 +0800
Subject: [PATCH] 2023年09月06日14:39:55
---
HDL_ON/DAL/DriverLayer/Control.cs | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index c9f3c21..85737d2 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -626,6 +626,10 @@
{
foreach (var temp in functions)
{
+ if((temp.trait_on_off.state.ToString() == "on" && open)|| temp.trait_on_off.state.ToString() == "off"&& !open)
+ {
+ continue;
+ }
var apiControlData = temp.GetApiControlData(d);
actionObjs.Add(apiControlData);
count++;
@@ -637,7 +641,10 @@
System.Threading.Thread.Sleep(100);
}
}
- var pack = pm.ControlDevice(actionObjs);
+ if (actionObjs.Count > 0)
+ {
+ var pack = pm.ControlDevice(actionObjs);
+ }
}
}
@@ -863,7 +870,7 @@
},
time_stamp = Utlis.GetTimestamp()
};
- var aLinkJson = Newtonsoft.Json.JsonConvert.SerializeObject(aLinkData);
+ var aLinkJson = JsonConvert.SerializeObject(aLinkData);
var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlScene, aLinkJson);
new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id, 0);
}
--
Gitblit v1.8.0