From df93e50c747a585aa3acad599ba9be7d9617872d Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 21 四月 2022 10:28:48 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/wjc' into Dev-Branch --- HDL_ON/DAL/Mqtt/MqttClient.cs | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index c74affe..60f8d2a 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -218,6 +218,12 @@ Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/appDeviceRefresh/up", QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }; + //璁惧鍦ㄧ嚎绂荤嚎鐘舵�佹帹閫� + var deviceOnlinePush = new MqttTopicFilter() + { + Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/son/session/online", + QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce + }; //appRoomRefresh锛氭埧闂存暟鎹埛鏂伴�氱煡 var appRoomRefresh = new MqttTopicFilter() { @@ -253,6 +259,7 @@ pirStatus,pirStudy, appDeviceRefresh,appHomeRefresh,appRoomRefresh,residenceChange, topicFilterPush2, topicAlinkStatus ,mqttkeyChange, + deviceOnlinePush, securityStatusChange}); if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0) { @@ -344,6 +351,32 @@ var mMes = Encoding.UTF8.GetString(e.ApplicationMessage.Payload); //鏂版尋涓嬬嚎涓婚鏂规 鏀跺埌鎸や笅绾夸富棰� ReceiveNotifySqueezeAsync(mMes); + } + //璁惧鍦ㄧ嚎绂荤嚎鐘舵�佹帹閫� + else if(topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/son/session/online") + { + try + { + //var mMes = Encoding.UTF8.GetString(e.ApplicationMessage.Payload); + //Newtonsoft.Json.Linq.JObject pairs = Newtonsoft.Json.Linq.JObject.Parse(mMes); + //var pairSid = pairs.GetValue("sid").ToString(); + //var pairOnline = pairs.GetValue("online"); + //if (!string.IsNullOrEmpty(pairSid.ToString())) + //{ + // var function_online = FunctionList.List.Functions.Find((obj) => obj.sid == pairSid); + // if (function_online != null){ + // function_online.online = (bool)pairOnline; + // HomePage.LoadEvent_RefreshDevcieOnline(function_online); + // FunctionPage.UpdataOnline(function_online); + // RoomPage.UpdataOnline(function_online); + // } + //} + + } + catch(Exception ex) + { + + } } //App璁㈤槄绾㈠瀹�/缃戝叧閬ユ帶鍣ㄦ坊鍔犳垚鍔熼�氱煡 else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/topo/found") @@ -478,6 +511,7 @@ } #endregion //A缃戝叧璁惧鐘舵��-鍖呭惈娑傞甫璁惧 + //Tag 缃戠粶鐘舵�佽В鏋� else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/property/send") { var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); -- Gitblit v1.8.0