From d9ec9be857367028edaeffb6092b141664a81c45 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期日, 23 一月 2022 11:30:46 +0800 Subject: [PATCH] 房间设备刷新 --- HDL_ON/DAL/DriverLayer/Control.cs | 41 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 277b20b..051b41d 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -1,6 +1,7 @@ 锘縰sing System; using System.Collections.Generic; using System.Text; +using HDL_ON.DAL.Server; using HDL_ON.Entity; using HDL_ON.UI; using Shared; @@ -768,8 +769,8 @@ topicAndLengthBytes.CopyTo(sendDataBytes, 0); bodyBytes.CopyTo(sendDataBytes, topicAndLengthBytes.Length); - //var sendDataString = Encoding.UTF8.GetString(sendDataBytes); - //MainPage.Log($"杞崲HDL-Link鏁版嵁\r\n{sendDataString}\r\n"); + var sendDataString = Encoding.UTF8.GetString(sendDataBytes); + MainPage.Log($"杞崲HDL-Link鏁版嵁\r\n{sendDataString}\r\n"); //*************************************************************** return sendDataBytes; @@ -979,9 +980,11 @@ var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid); if (localFunction == null) { - Console.WriteLine("鎵句笉鍒伴煶涔愭挱鏀惧櫒娣�=======" + revString); + MainPage.Log("鎵句笉鍒伴煶涔愭挱鏀惧櫒娣�=======" + revString); continue; } + MainPage.Log(localFunction.name); + if (Ins.GatewayOnline_Local && isCloudData)//鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞� { if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk) && !SPK.MusicSpkList().Contains( localFunction.spk)) @@ -1006,7 +1009,7 @@ { localFunction.time_stamp = temp.time_stamp; localFunction.SetAttrState(attr.key, attr.value); - Console.WriteLine("闊充箰鎾斁鍣ㄦ坊鍔犵紦瀛樻暟鎹�=======" + revString); + //Console.WriteLine("闊充箰鎾斁鍣ㄦ坊鍔犵紦瀛樻暟鎹�=======" + revString); } @@ -1211,5 +1214,35 @@ } } + + + #region 闂ㄩ攣 + + /// <summary> + /// //涓�閿紙杩滅▼锛夊紑閿� + /// </summary> + public void OneKeyUnlocking(Function doorlock,string extStr) + { + if (Ins.GatewayOnline_Local) + { + Dictionary<string, string> dic = new Dictionary<string, string>(); + var functionControlDataObj = doorlock.GetGatewayAlinkDoorlockData(UserInfo.Current.ID,extStr); + var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj); + var sendBytes = Ins.ConvertSendBodyData($"/base/{Control.Ins.GatewayId}/thing/service/doorRemoteOpen/down", functionControlDataJson); + new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, 0); + } + else + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("deviceId", doorlock.deviceId); + var requestJson = HttpUtil.GetSignRequestJson(d); + HttpUtil.RequestHttpsPost("/home-wisdom/app/device/door/remoteOpen", requestJson); + } + } + //瀵嗙爜鍐荤粨 + //瀵嗙爜楠岃瘉 + + #endregion } } \ No newline at end of file -- Gitblit v1.8.0