From 49add64d7f25448baa06ac5a9ebbeac0a3ae97e0 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期一, 13 一月 2020 13:50:29 +0800 Subject: [PATCH] Version 2.50113 1.优化更新。 2.第一次引导或者添加住宅,默认添加2个房间。编辑住宅不处理。 3.设备名超过20字节限制。 4.修复编辑住宅名字重复不提示问题。 5.优化添加住宅逻辑。 --- Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs b/Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs index ae7399e..97e1c46 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs @@ -103,7 +103,10 @@ var aesDecryptPayload = e.ApplicationMessage.Payload; //Console.WriteLine ("Topic={0}", aesDecryptTopic); - if (aesDecryptTopic == $"NotifyBusGateWayInfoChagne/{CurRemoteMACInfo.md5_mac_string}") {//缃戝叧涓婄嚎锛岄渶瑕佹洿鏂癮eskey + + //if (aesDecryptTopic == $"NotifyBusGateWayInfoChagne/{CurRemoteMACInfo.md5_mac_string}") {//缃戝叧涓婄嚎锛岄渶瑕佹洿鏂癮eskey + //2020-01-11 淇敼璁㈤槄涓婚鍦板潃 + if (aesDecryptTopic == $"BusGateWayToClient/{CurRemoteMACInfo.macMark}/NotifyBusGateWayInfoChange") {//缃戝叧涓婄嚎锛岄渶瑕佹洿鏂癮eskey Console.WriteLine ("缃戝叧涓婄嚎锛岄渶瑕佹洿鏂癮eskey"); //----绗簩姝ワ細璇诲彇璐﹀彿涓嬮潰鐨勭綉鍏冲垪琛� var gatewayListUrl = $"{MainPage.RequestHttpsHostMqtt}/Center/Center/GetGatewayPagger"; //App銆丅uspro杞欢鐧诲綍鍚庤幏鍙栫綉鍏冲垪琛� http 璇锋眰 @@ -251,7 +254,7 @@ requestObj3.ReqDto.LoginAccessToken = MainPage.LoginUser.LoginTokenString; requestObj3.ReqDto.HomeId = UserConfig.Instance.CurrentRegion.Id; requestObj3.ReqDto.PageSetting.Page = 1; - requestObj3.ReqDto.PageSetting.PageSize = 999; + requestObj3.ReqDto.PageSetting.PageSize = 10; string urlHead = MainPage.RequestHttpsHost; if (requestObj3.IsOtherAccountCtrl) { urlHead = UserConfig.Instance.MasterAccountRequestBaseUrl; @@ -264,14 +267,8 @@ var revertObj3 = MainPage.RequestHttps (API.GetSingleHomeGatewayPagger, requestJson3, urlHead); if (revertObj3.StateCode.ToUpper() == "SUCCESS") { var infoResult = Newtonsoft.Json.JsonConvert.DeserializeObject<GetGatewayResult> (revertObj3.ResponseData.ToString ()); - var gatewayList = infoResult.PageData; - if (gatewayList != null && gatewayList.Count > 0) { - if (UserConfig.Instance.CheckHomeGateways ()) { - UserConfig.Instance.CurrentRegion.HomeGateways [0].GatewayUniqueId = gatewayList [0].GatewayUniqueId; - UserConfig.Instance.SaveUserConfig (); - Console.WriteLine ("Remote mqtt get Region MAC : " + gatewayList [0].GatewayUniqueId); - } - } + //2020-01-11 + UserConfig.Instance.SetNowHomeGateways (infoResult.PageData); } else { //鎻愮ず閿欒 //GetSingleHomeGatewayPagger @@ -419,9 +416,11 @@ CurRemoteMACInfo.md5_mac_string = builder.ToString ().ToUpper (); } - topicName = $"/NotifyBusGateWayInfoChagne/{CurRemoteMACInfo.md5_mac_string}"; + //topicName = $"/NotifyBusGateWayInfoChagne/{CurRemoteMACInfo.md5_mac_string}"; + //2020-01-11 淇敼璁㈤槄涓婚鍦板潃 + topicName = $"BusGateWayToClient/{CurRemoteMACInfo.macMark}/NotifyBusGateWayInfoChange"; //if (remoteIsConnected) { - try { + try { await RemoteMqttClient.SubscribeAsync (topicName); } catch (Exception e) { await DisConnectRemoteMqttClient (e.Message); -- Gitblit v1.8.0