From 8e4dd3cdef1348bcf1285576bb946afb85ce2526 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 08 十二月 2020 17:31:27 +0800
Subject: [PATCH] 增加分享设备的时候,判断当前房间分享设备总数,从而决定是否需要增加或者移除房间分享
---
HDL_ON/DAL/DriverLayer/Packet.cs | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs
index 6fce368..1caa9ff 100644
--- a/HDL_ON/DAL/DriverLayer/Packet.cs
+++ b/HDL_ON/DAL/DriverLayer/Packet.cs
@@ -163,12 +163,12 @@
case Command.ReadLightAllLoopBrightnessACK:
for (int i = 0; i < receiveBytes[0]; i++)
{
- var light = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.LoopID == (i + 1));
+ var light = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == (i + 1));
if (light != null)
{
if (light.functionType != FunctionType.RGB)
{
- light.trait_on_off.curValue = receiveBytes[light.bus_Data.LoopID] == 0 ? "off" : "on";
+ light.trait_on_off.curValue = receiveBytes[light.bus_Data.loopId] == 0 ? "off" : "on";
if (light.trait_on_off.curValue.ToString() == "on")
{
light.brightness = receiveBytes[2];
@@ -191,7 +191,7 @@
}
else
{
- var e = DB_ResidenceData.functionList.electricals.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.LoopID == i);
+ var e = DB_ResidenceData.functionList.electricals.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == i);
if (e != null)
{
var fan = e as Fan;
@@ -266,7 +266,7 @@
}
else
{
- if (curtain.bus_Data.LoopID != receiveBytes[0])
+ if (curtain.bus_Data.loopId != receiveBytes[0])
continue;
switch (receiveBytes[1])
{
@@ -448,7 +448,7 @@
if (sensor.bus_Data != null)
{
if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus_Data.SubnetID == subnetID &&
- sensor.bus_Data.DeviceID == deviceID && sensor.bus_Data.LoopID == receiveBytes[2])
+ sensor.bus_Data.DeviceID == deviceID && sensor.bus_Data.loopId == receiveBytes[2])
{
switch (dt)
{
@@ -481,7 +481,7 @@
if (sensor.bus_Data != null)
{
if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus_Data.SubnetID == subnetID &&
- sensor.bus_Data.DeviceID == deviceID && sensor.bus_Data.LoopID == receiveBytes[2])
+ sensor.bus_Data.DeviceID == deviceID && sensor.bus_Data.loopId == receiveBytes[2])
{
//0淇濈暀 1鏃犵鍙�4Byte鏁村舰 2鏈夌鍙�4Byte鏁村舰 3Float褰紙浠B憋級
switch (receiveBytes[3])
@@ -575,6 +575,7 @@
if (DB_ResidenceData.residenceData.residenceGatewayMAC == mac)
{
DriverLayer.Control.Ins.GatewayOnline = true;
+ DriverLayer.Control.Ins.IsRemote = false;
}
break;
}
--
Gitblit v1.8.0