From 1cd93851bde6ec19c07f1445899a76ab0dfa507d Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期四, 13 四月 2023 16:01:53 +0800
Subject: [PATCH] 1.增加推送判断是否加载了类的方法 2.修改launch screen引用 3.去掉门锁测试环境appkey逻辑

---
 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
index e58062f..4591f0b 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
@@ -1,5 +1,8 @@
 锘縰sing System;
 using System.Collections.Generic;
+using HDL_ON.Common;
+using HDL_ON.DAL.Server;
+using HDL_ON.DriverLayer;
 using Shared;
 
 namespace HDL_ON.Entity
@@ -86,8 +89,6 @@
         /// </summary>
         public List<GroupControlFunction> sids = new List<GroupControlFunction>();
 
-
-
         ///// <summary>
         ///// 鑾峰彇璁惧娣诲姞鍒版埧闂寸殑鎴块棿鍚嶇О
         ///// </summary>
@@ -114,6 +115,57 @@
         //    }
         //    return roomNameList;
         //}
+
+        /// <summary>
+        /// 缇ゆ帶鎺у埗
+        /// </summary>
+        /// <param name="pairs"></param>
+        public void Control(Dictionary<string,object> pairs)
+        {
+            try
+            {
+               
+                if (DriverLayer.Control.Ins.GatewayOnline_Local)
+                {
+                    var controlValues = new Dictionary<string, string>();
+                    foreach (var p in pairs)
+                    {
+                        controlValues.Add("key", p.Key);
+                        controlValues.Add("value", p.Value.ToString());
+                    }
+                    var functionControlDataObj = GetGatewayAlinkControlData(controlValues);
+                    var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj);
+                    var sendBytes = DriverLayer.Control.Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson);
+                    new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, 3);
+                    MainPage.Log($"鏈湴閫氳 鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}");
+                }
+                else
+                {
+                    
+                    var controlValues = new Dictionary<string, object>();
+                    foreach (var p in pairs)
+                    {
+                        controlValues.Add("key", p.Key);
+                        controlValues.Add("value", p.Value);
+                    }
+                    var pack = ApiUtlis.Ins.HttpRequest.ControlGroupControl(userDeviceGroupControlId, controlValues);
+                    if (pack != null)
+                    {
+                        if (pack.Code == StateCode.SUCCESS)
+                        {
+                            //DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl.
+                        }
+                        else
+                        {
+                            MainPage.Log($"缇ゆ帶鎺у埗澶辫触,Code: {pack.Code}");
+                        }
+                    }
+                }
+            }
+            catch (Exception ex){
+                MainPage.Log($"缇ゆ帶鎺у埗澶辫触: {ex.Message}");
+            }
+        }
     }
 
     public class GroupControlFunction
@@ -126,6 +178,8 @@
         /// 鍔熻兘spk
         /// </summary>
         public string spk = string.Empty;
+
+
     }
 
 

--
Gitblit v1.8.0