From eb0b148e543c1dc4c1925184212868776a6f7417 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 18 十二月 2020 15:55:58 +0800
Subject: [PATCH] Merge branch 'WJC' into NewFilePath
---
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 47 ++++++++++++++++++++++++++++++-----------------
1 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
old mode 100644
new mode 100755
index 005478a..39ecc10
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -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