From 0abce7f2d672aa934dd0c2ff278638de590f10d8 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 26 九月 2023 10:57:15 +0800
Subject: [PATCH] 场景集成海信电视控制

---
 HDL_ON/Entity/Function/Scene.cs                                |    5 +++++
 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs |   14 +++++++++++---
 HDL_ON/UI/UI1-Login/LoginPage.cs                               |   17 +++++++++++++++++
 3 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index c2844b4..35fba28 100644
--- a/HDL_ON/Entity/Function/Scene.cs
+++ b/HDL_ON/Entity/Function/Scene.cs
@@ -592,6 +592,11 @@
             var modeState = status.Find((obj) => obj.key == FunctionAttributeKey.Mode);
             var tempState = status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp);
             var fanState = status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed);
+            ////娴蜂俊鐢佃鐘舵��
+            //var hisenseTvState = status.Find((obj) => obj.key == "wol");
+            //if(hisenseTvState != null)
+            //{
+            //}
             if (modeState != null)
             {
                 sceneFunctionInfo += modeState.GetValueText() + " ";
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index c545825..a62f728 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -926,6 +926,23 @@
 
 
 #if DEBUG
+                var hesTv = new Function()
+                {
+                    sid = "hisense000000000001",
+                    deviceId = "hisense000000000001",
+                    name = "娴蜂俊鐢佃",
+                    spk = SPK.ElectricalTvHisense,
+
+                    roomIds = new List<string>() { "1405771024583090178" },
+                    attributes = new List<FunctionAttributes>()
+                    {
+                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "off" }, curValue="on",state = "on"   },
+                        new FunctionAttributes() { key = "wol",value =new List<string>(){ "on" }, curValue="on",state = "on"   },
+                    }
+                };
+                hesTv.SaveFunctionFile();
+
+
                 var airSwitchP3 = new Function()
                 {
                     sid = "airSwitchP3000000000001",
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
index 62dc7d0..05041cf 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -193,10 +193,18 @@
                         }
                         else
                         {
-                            var isHasColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
-                            if (isHasColorful != null)
+                            if (sceneFunction.localFunction.spk == SPK.ElectricalTvHisense)
                             {
-                                sceneFunction.status.Remove(isHasColorful);
+                                sceneFunction.status.Clear();
+                                sceneFunction.status.Add(new SceneFunctionStatus() { key = "wol", value = "on" });
+                            }
+                            else
+                            {
+                                var isHasColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
+                                if (isHasColorful != null)
+                                {
+                                    sceneFunction.status.Remove(isHasColorful);
+                                }
                             }
                         }
                     }

--
Gitblit v1.8.0