wei
2020-12-17 bb6ad792b598927a5459a5fb6f6c27fb1aa9e94e
HDL_ON/DAL/DriverLayer/Packet.cs
@@ -163,12 +163,12 @@
                    case Command.ReadLightAllLoopBrightnessACK:
                        for (int i = 0; i < receiveBytes[0]; i++)
                        {
                            var light = FunctionList.List.lights.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.loopId == (i + 1));
                            var light = FunctionList.List.lights.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.LoopId == (i + 1));
                            if (light != null)
                            {
                                if (light.functionType != FunctionType.RGB)
                                {
                                    light.trait_on_off.curValue = receiveBytes[light.bus.loopId] == 0 ? "off" : "on";
                                    light.trait_on_off.curValue = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on";
                                    if (light.trait_on_off.curValue.ToString() == "on")
                                    {
                                        light.brightness = receiveBytes[2];
@@ -191,7 +191,7 @@
                            }
                            else
                            {
                                var e = FunctionList.List.electricals.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.loopId == i);
                                var e = FunctionList.List.electricals.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.LoopId == i);
                                if (e != null)
                                {
                                    var fan = e as Fan;
@@ -264,7 +264,7 @@
                                }
                                else
                                {
                                    if (curtain.bus.loopId != receiveBytes[0])
                                    if (curtain.bus.LoopId != receiveBytes[0])
                                        continue;
                                    switch (receiveBytes[1])
                                    {
@@ -446,7 +446,7 @@
                            if (sensor.bus != null)
                            {
                                if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus.SubnetID == subnetID &&
                                    sensor.bus.DeviceID == deviceID && sensor.bus.loopId == receiveBytes[2])
                                    sensor.bus.DeviceID == deviceID && sensor.bus.LoopId == receiveBytes[2])
                                {
                                    switch (dt)
                                    {
@@ -479,7 +479,7 @@
                            if (sensor.bus != null)
                            {
                                if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus.SubnetID == subnetID &&
                                    sensor.bus.DeviceID == deviceID && sensor.bus.loopId == receiveBytes[2])
                                    sensor.bus.DeviceID == deviceID && sensor.bus.LoopId == receiveBytes[2])
                                {
                                    //0保留 1无符号4Byte整形  2有符号4Byte整形  3Float形(代±)
                                    switch (receiveBytes[3])