wei
2021-01-27 7232642ff48a7fbde2018cde652f3e771fa58025
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -353,8 +353,25 @@
                        var light = function as Light;
                        switch (light.spk)
                        {
                            case SPK.LightCCT:
                                byte b0 = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0
                                if (light.trait_on_off.curValue.ToString() == "off")
                                {
                                    b0 = 0;
                                }
                                else
                                {
                                    b0 = (byte)light.brightness == 0 ? (byte)100 : (byte)light.brightness;
                                }
                                var bytes0 = new byte[] { function.bus.LoopId,
                                            b0,
                                            254, 0,Convert.ToByte(light.fadeTime) ,2,
                                            (byte)((int)light.Attr_CCT.curValue/256),(byte)((int)light.Attr_CCT.curValue%256),
                                            (byte)light.BlueColor,
                                            0,0};
                                ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes0, 1);
                                break;
                            case SPK.LightRGB:
                                MainPage.Log($"rgb level : {light.brightness}");
                                byte b = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0
                                if (light.trait_on_off.curValue.ToString() == "off")
                                {
@@ -590,6 +607,9 @@
                            case SPK.LightRGB:
                                ControlBytesSend(Command.ReadLogicLoopColor, subnetId, deviceId, new byte[] { function.bus.LoopId });
                                break;
                            case SPK.LightCCT:
                                ControlBytesSend(Command.ReadLogicLoopColor, subnetId, deviceId, new byte[] { function.bus.LoopId });
                                break;
                        }
                        break;
                    case FunctionCategory.Curtain: