From 9b5399d3dd4299563821af0a7131f9a52402feea Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 11 九月 2020 17:42:19 +0800 Subject: [PATCH] 20209112 --- HDL_ON/DriverLayer/Control.cs | 64 +++++-------------------------- 1 files changed, 11 insertions(+), 53 deletions(-) diff --git a/HDL_ON/DriverLayer/Control.cs b/HDL_ON/DriverLayer/Control.cs index ed96608..f27acb1 100644 --- a/HDL_ON/DriverLayer/Control.cs +++ b/HDL_ON/DriverLayer/Control.cs @@ -3,6 +3,7 @@ using HDL_ON.DAL; using HDL_ON.DAL.Net; using HDL_ON.Entity; +using HDL_ON.UI; namespace HDL_ON { @@ -13,7 +14,7 @@ /// </summary> public static void Send(Function function) { - switch(function.functionCategory) + switch (function.functionCategory) { case FunctionCategory.Scene: ControlScene(function as Scene); @@ -114,7 +115,7 @@ { curtainState = 1; } - else if (function.trait_on_off.value.ToString() =="off") + else if (function.trait_on_off.value.ToString() == "off") { curtainState = 2; } @@ -154,7 +155,7 @@ case FunctionType.Relay: case FunctionType.Dimmer: byte brightness = 0; - if(function.trait_on_off.value.ToString() == "on") + if (function.trait_on_off.value.ToString() == "on") { var brightnessTrait = function.function.Find((obj) => obj.name == "brightness"); if (brightnessTrait != null) @@ -257,7 +258,7 @@ ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus_Data.LoopID, b1, - 0, 0 }); + 0, Convert.ToByte(light.fadeTime) }); break; case FunctionType.Relay: ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus_Data.LoopID, light.trait_on_off.value.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 }); @@ -393,55 +394,12 @@ } break; } - - - foreach (var dic in commandDictionary) - { - switch (dic.Key) - { - case "on_off": - break; - case "brightness": - break; - case "color": - break; - default: - MainPage.Log($"鍔熻兘鏈敮鎸� : {dic.Key}"); - break; - //case "cct": - //case "delay": - //case "fade_time": - //case "open_level": - //case "lock": - //case "ico": - //case "mode": - //case "fan": - //case "temp": - //case "swing": - //case "set_ point": - //case "pm25": - //case "volume": - //case "vol_step": - //case "source": - //case "treble": - //case "bass": - //case "playlist": - //case "song_name": - //case "current_status": - //case "enable": - //case "lux": - //case "adjust_value": - //case "range": - //case "humidity": - //case "type": - //case "state": - //case "sensitivity": - //case "pm25value": - } - } - - - + #region 鍙戦�佸懡浠ょ珛鍗虫洿鏂癠I + HomePage.UpdataFunctionStates(function); + RoomPage.UpdataStates(function); + FunctionPage.UpdataStates(function); + ClassificationPage.UpdataInfo(function); + #endregion } catch (Exception ex) { -- Gitblit v1.8.0