From 6a8eb1ce9d8e34c50164a4e24e7098e681ee08b6 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 06 十一月 2023 15:08:06 +0800 Subject: [PATCH] 国际化支持:场景增加自动化使能配置 --- HDL_ON/DAL/Mqtt/MqttClient.cs | 50 +++++--------------------------------------------- 1 files changed, 5 insertions(+), 45 deletions(-) diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index 0358a57..4353a7f 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -111,7 +111,7 @@ { MqttInfoConfig.Current.IfGetMqttInfoSuccess = false; } - Control.Ins.GatewayOnline_Cloud = Control.Ins.GatewayOnline_Local = false; + //Control.Ins.GatewayOnline_Cloud = Control.Ins.GatewayOnline_Local = false; await DisConnectRemoteMqttClient(s); } @@ -145,6 +145,7 @@ await StartCloudMqtt(); await SubscribeTopics(); + } catch { } } @@ -491,48 +492,6 @@ else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/appDeviceRefresh/up") { MainPage.Log("璁惧鏁版嵁鍒锋柊閫氱煡"); - var deviceResult = new HttpServerRequest().GetDeviceList(); - if (deviceResult.Code == StateCode.SUCCESS) - { - MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛"); - var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); - if (deviceList == null) - { - deviceList = new DevcieApiPack(); - } - string delFile = ""; - if (FunctionList.List.GetDeviceFunctionList().Count > 0) - { - for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;) - { - var localFunction = FunctionList.List.GetDeviceFunctionList()[i]; - if (SPK.MusicSpkList().Contains(localFunction.spk)) - { - i++; - continue; - } - var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId); - - if (delFile == localFunction.savePath) - { - i++; - continue; - } - delFile = localFunction.savePath; - FunctionList.List.DeleteFunction(localFunction); - } - } - //澶勭悊鍓╀笅鐨勬柊澧炲姛鑳� - foreach (var newFunction in deviceList.list) - { - newFunction.SaveFunctionFile(); - FunctionList.List.IniFunctionList(newFunction.savePath); - } - } - else - { - MainPage.Log($"璇诲彇浜戠璁惧鏁版嵁澶辫触:Code:{deviceResult.Code}; Msg:{deviceResult.message}"); - } } //缃戝叧瀵嗛挜鍙樺寲 else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/custom/mqtt/secret/change") @@ -591,7 +550,7 @@ { var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); var revString = Encoding.UTF8.GetString(bytes); - MainPage.Log($"mqtt 鐘舵�佹洿鏂�:{revString}"); + //MainPage.Log($"mqtt 鐘舵�佹洿鏂�:{revString}"); Control.Ins.UpdataFunctionStatus(revString, null, true); //Control.Ins.MsgInfoList.Add($"mqtt 鐘舵�佹洿鏂�:{revString}"); //Control.Ins.MsgInfoList.Add(revString + "\r\n"); @@ -879,6 +838,7 @@ //娴嬭瘯璐﹀彿锛屼笉鎸や笅绾� switch (UserInfo.Current.userMobileInfo) { + case "18316672920": case "15626203746": case "464027401@qq.com": return; @@ -1021,7 +981,7 @@ MqttInfoConfig.Current.mMqttInfo = mqttInfoRequestResult_Obj; - await MQTTConnectAsync(); + //await MQTTConnectAsync(); //1.鍒ゆ柇鏄惁缁戝畾浜嗙綉鍏筹紝鑾峰彇缃戝叧杩滅▼杩炴帴鐨勫姞瀵咾EY //if (DB_ResidenceData.Instance.CheckWhetherGatewayIsBound()) { -- Gitblit v1.8.0