From 3f6685c77beeb12baf840733fb890860f4c26e7c Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期四, 25 七月 2024 17:25:59 +0800 Subject: [PATCH] 2024年07月25日17:24:45 --- HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 1 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs index 525e5e4..f4873e7 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs @@ -73,6 +73,56 @@ } /// <summary> + /// 鍒锋柊璁惧鐘舵�� + /// </summary> + /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param> + /// <returns></returns> + public bool RefreshDeviceStatus(List<string> functionIds, TipType tipType = TipType.flicker) + { + try + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("deviceIds", functionIds); + var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_RefreshDeviceStatus, "鍒锋柊璁惧鐘舵��"); + if (!this.DataChecking(responsePackNew, tipType)) + { + return false; + } + return true; + } + catch + { + return false; + } + } + + /// <summary> + /// 鑾峰彇璁惧璇︽儏 + /// </summary> + /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param> + /// <returns></returns> + public Function GetDeviceInfo(string functionId, TipType tipType = TipType.flicker) + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("deviceIds", new List<string>() { functionId }); + + var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GetDevcieInfoList, "鑾峰彇璁惧璇︽儏"); + if (!this.DataChecking(responsePackNew, tipType)) + { + return null; + } + var functionList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Function>>(responsePackNew.Data.ToString()); + if (functionList != null && functionList.Count > 0) + { + return functionList[0]; + } + return null; + + } + + /// <summary> ///鍒犻櫎璁惧 /// </summary> /// <param name="deviceId">璁惧id</param> @@ -180,7 +230,7 @@ { if (TipType.flicker == tipType) { - if (responsePackNew == null) + if (responsePackNew == null || responsePackNew.Code == "-1") { responsePackNew = new ResponsePackNew { message = "娌″洖澶�,璇风‘璁ょ綉缁滄槸鍚︽甯�.", Code = "-1", }; } -- Gitblit v1.8.0