From 1a0a7f736c6d2e7129e7591d40bed67ec7c0f09a Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期五, 05 二月 2021 10:47:42 +0800 Subject: [PATCH] 2021-02-05 1.编译冲突修改 --- HDL_ON/DAL/DriverLayer/Control_Udp.cs | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs index 5d91266..5789606 100644 --- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs +++ b/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;//寮�鍏虫搷浣滀緷鎹畂n_off瀛楁锛屽疄闄呭紑鍏冲�间緷鎹産rightness锛屽綋on_off涓烘墦寮�锛宐rightness涓嶈兘涓�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;//寮�鍏虫搷浣滀緷鎹畂n_off瀛楁锛屽疄闄呭紑鍏冲�间緷鎹産rightness锛屽綋on_off涓烘墦寮�锛宐rightness涓嶈兘涓�0 if (light.trait_on_off.curValue.ToString() == "off") { @@ -588,6 +605,9 @@ ControlBytesSend(Command.ReadLightAllLoopBrightness, subnetId, deviceId, new byte[] { }); break; 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; } -- Gitblit v1.8.0