From af6a098440ab45a5da3d7fe20d30d08a87ea4b6a Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期五, 10 六月 2022 13:59:58 +0800
Subject: [PATCH] 2022年06月10日13:59:24

---
 HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
index a8d34a9..3205232 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
@@ -88,11 +88,12 @@
         /// </summary>
         void LoadEvent_DimmerBar()
         {
-            if (function.online)
+            //if (function.online)
             {
                 dimmerBar.OnStartTrackingTouchEvent = (sender, e) =>
                 {
                     onDimmerBar = true;
+                    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                 };
                 dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
                 {
@@ -100,13 +101,17 @@
                     function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress);
                     System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                     d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString());
+                    if(dimmerBar.Progress > 0)
+                    {
+                        d.Add(FunctionAttributeKey.OnOff, "on");
+                    }
                     Control.Ins.SendWriteCommand(function, d);
                     btnBrightnessText.Text = dimmerBar.Progress + "%";
                 };
                 //20201223 鍒犻櫎婊戝姩鍙戦�佸懡浠わ紝闃叉鎺т欢璺冲姩
                 dimmerBar.OnProgressChangedEvent = (sender, e) =>
                 {
-                    dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
+                   
                 //function.fadeTime = 0;
                 //if (!btnSwitch.IsSelected)
                 //{
@@ -148,16 +153,16 @@
         {
             btnSwitch.MouseUpEventHandler += (sender, e) =>
             {
-                if (!function.online)
-                {
-                    new Tip()
-                    {
-                        CloseTime = 1,
-                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-                        Direction = AMPopTipDirection.None,
-                    }.Show(MainPage.BaseView);
-                    return;
-                }
+                //if (!function.online)
+                //{
+                //    new Tip()
+                //    {
+                //        CloseTime = 1,
+                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                //        Direction = AMPopTipDirection.None,
+                //    }.Show(MainPage.BaseView);
+                //    return;
+                //}
                 btnSwitch.IsSelected = !btnSwitch.IsSelected;
                 if (btnSwitch.IsSelected)
                 {
@@ -172,6 +177,7 @@
                     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(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
+                    d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                     if (btnSwitch.IsSelected)
                     {
                         if(function.lastBrightness == 0)

--
Gitblit v1.8.0