From 57da7ebc02985578f65fd3435fd83e482bd76c45 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 26 二月 2021 09:21:55 +0800
Subject: [PATCH] 2021-02-26 1.场景转换调光灯增加on_off属性

---
 Crabtree/SmartHome/HDL/Common/HDLLinkUtlis.cs |   22 ++++++++++++++++------
 Crabtree/.vs/SmartHome/xs/UserPrefs.xml       |    7 +------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/Crabtree/.vs/SmartHome/xs/UserPrefs.xml b/Crabtree/.vs/SmartHome/xs/UserPrefs.xml
index 4a6d0a2..4ed80cb 100644
--- a/Crabtree/.vs/SmartHome/xs/UserPrefs.xml
+++ b/Crabtree/.vs/SmartHome/xs/UserPrefs.xml
@@ -2,12 +2,7 @@
   <MonoDevelop.Ide.ItemProperties.ON.Droid PreferredExecutionTarget="Android.Android_Accelerated_Oreo" />
   <MonoDevelop.Ide.Workbench ActiveDocument="SmartHome/HDL/Common/HDLLinkUtlis.cs">
     <Files>
-      <File FileName="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaSettingDevicePage.cs" Line="291" Column="44" />
-      <File FileName="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaSettingScenePage.cs" />
-      <File FileName="SmartHome/HDL/Common/HttpUtil/HttpServerRequest.cs" />
-      <File FileName="SmartHome/HDL/Common/HttpUtil/NewAPI.cs" />
-      <File FileName="SmartHome/HDL/Common/HDLLinkUtlis.cs" Line="724" Column="32" />
-      <File FileName="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs" />
+      <File FileName="SmartHome/HDL/Common/HDLLinkUtlis.cs" Line="373" Column="34" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
diff --git a/Crabtree/SmartHome/HDL/Common/HDLLinkUtlis.cs b/Crabtree/SmartHome/HDL/Common/HDLLinkUtlis.cs
index ca01b81..5147063 100644
--- a/Crabtree/SmartHome/HDL/Common/HDLLinkUtlis.cs
+++ b/Crabtree/SmartHome/HDL/Common/HDLLinkUtlis.cs
@@ -267,13 +267,18 @@
                         var commonNew = Newtonsoft.Json.JsonConvert.DeserializeObject<LightDimming> (jsonInfo);
                         var mSceneFunction = new SceneFunction ();
                         mSceneFunction.sid = function.sid;
-                        //1.Brightness
+                        //1.on_off
                         var status = new List<SceneFunctionStatus> ();
+                        status.Add (new SceneFunctionStatus () {
+                            key = FunctionAttributeKey.OnOff,
+                            value = commonNew.CurrentBrightness > 0 ? "on" : "off",
+                        });
+                        //2.Brightness
                         status.Add (new SceneFunctionStatus () {
                             key = FunctionAttributeKey.Brightness,
                             value = commonNew.CurrentBrightness.ToString(),
                         });
-                        //2.Delay
+                        //3.Delay
                         status.Add (new SceneFunctionStatus () {
                             key = FunctionAttributeKey.Delay,
                             value = (commonNew.DelayTimeHeight * 256 + commonNew.DelayTimeLow).ToString (),
@@ -326,19 +331,24 @@
                         var commonNew = Newtonsoft.Json.JsonConvert.DeserializeObject<LightLogic> (jsonInfo);
                         var mSceneFunction = new SceneFunction ();
                         mSceneFunction.sid = function.sid;
-                        //1.Brightness
+                        //1.on_off
                         var status = new List<SceneFunctionStatus> ();
+                        status.Add (new SceneFunctionStatus () {
+                            key = FunctionAttributeKey.OnOff,
+                            value = commonNew.CurrentBrightness > 0 ? "on" : "off",
+                        });
+                        //2.Brightness
                         status.Add (new SceneFunctionStatus () {
                             key = FunctionAttributeKey.Brightness,
                             value = commonNew.CurrentBrightness.ToString (),
                         });
-                        //2.Delay
+                        //3.Delay
                         status.Add (new SceneFunctionStatus () {
                             key = FunctionAttributeKey.Delay,
                             value = (commonNew.DelayTimeHeigh * 256 + commonNew.DelayTimeLow).ToString (),
                         });
 
-                        //3.rgb
+                        //4.rgb
                         status.Add (new SceneFunctionStatus () {
                             key = FunctionAttributeKey.RGB,
                             value = commonNew.RStatus + "," + commonNew.GStatus + "," + commonNew.BStatus,
@@ -365,7 +375,7 @@
                         var commonNew = Newtonsoft.Json.JsonConvert.DeserializeObject<LightSwitch> (jsonInfo);
                         var mSceneFunction = new SceneFunction ();
                         mSceneFunction.sid = function.sid;
-                        //1.Brightness
+                        //1.OnOff
                         var status = new List<SceneFunctionStatus> ();
                         status.Add (new SceneFunctionStatus () {
                             key = FunctionAttributeKey.OnOff,

--
Gitblit v1.8.0