From c96d59d6b6379acb0fd899ad2e255a121ee6c8c6 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 18 十二月 2020 10:45:20 +0800 Subject: [PATCH] 20201218-1 --- HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 49 +++++++++++++++++++++++++++++++------------------ 1 files changed, 31 insertions(+), 18 deletions(-) diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs index 8fbad13..39ecc10 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs @@ -81,7 +81,7 @@ scene.collect = false; string msg = scene.name + Language.StringByID(StringId.CollectionCancelled); LoadSceneFunctionControlZone(); - scene.SaveSceneData(true); + scene.CollectScene(); new PublicAssmebly().TipMsgAutoClose(msg, true); }; } @@ -217,9 +217,26 @@ new System.Threading.Thread(() => { function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; - System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - d.Add("on_off", function.trait_on_off.curValue.ToString()); - Control.Ins.SendWriteCommand(function, d); + Dictionary<string, string> d = new Dictionary<string, string>(); + if (function.spk == SPK.LightDimming || function.spk == SPK.LightRGB) + { + var light = function as Light; + d.Add(FunctionAttributeKey.OnOff, light.trait_on_off.curValue.ToString()); + if (btnSwitch.IsSelected) + { + d.Add(FunctionAttributeKey.Brightness, light.lastBrightness.ToString()); + } + else + { + light.lastBrightness = light.brightness; + } + Control.Ins.SendWriteCommand(light, d); + } + else + { + d.Add("on_off", function.trait_on_off.curValue.ToString()); + Control.Ins.SendWriteCommand(function, d); + } }) { IsBackground = true }.Start(); }; @@ -348,11 +365,8 @@ { ShowMesBtnState(pushMessageInfoList[0], true); }); - } - } - } else { @@ -366,9 +380,7 @@ { isGetting = false; } - }); - } /// <summary> @@ -404,7 +416,7 @@ { try { - return Utlis.UnixToDateTimeWithFormatMS(time, "HH:mm"); + return Utlis.ToFriendlyDisplay(time); } catch (Exception ex) { @@ -417,13 +429,14 @@ /// </summary> void RegisterGetPushMessageAction() { - //HDLCommon.GetPushMessageAction = () => { - // if (bodyView != null) - // { - // Utlis.WriteLine("GetPushMessageAction H鏀跺埌鎺ㄩ��"); - // GetUnreadPushMessages(); - // } - //}; + Action RegisterGetPushMessageAction = () => { + if (bodyView != null) + { + //Utlis.WriteLine("GetPushMessageAction H鏀跺埌鎺ㄩ��"); + GetUnreadPushMessages(); + } + }; + HDLCommon.GetPushMessageAction = RegisterGetPushMessageAction; } /// <summary> @@ -431,7 +444,7 @@ /// </summary> void UnregisterGetPushMessageAction() { - //HDLCommon.GetPushMessageAction = null; + HDLCommon.GetPushMessageAction = null; } #endregion -- Gitblit v1.8.0