From 5f6511a3f048b22bd1385acfd89dd201cdc40cec Mon Sep 17 00:00:00 2001 From: lixiaoyuan Date: Tue, 14 Oct 2025 09:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Gateway=5FYT=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E8=AE=A2=E9=98=85=E7=9A=84=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/Release/assets/config/app.json | 1 + src/app/Policy.cpp | 5 +++++ src/protocol/MqttEntity.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/Release/assets/config/app.json b/bin/Release/assets/config/app.json index 2de1fdd..6216437 100644 --- a/bin/Release/assets/config/app.json +++ b/bin/Release/assets/config/app.json @@ -26,6 +26,7 @@ "Cooling_YX": {"deviceType":14, "polling":1, "enabled": 1}, "Gateway_YX": {"deviceType":15, "polling":1, "enabled": 1}, "Gateway_YC": {"deviceType":15, "polling":1, "enabled": 1}, + "Gateway_YT": {"deviceType":15, "polling":0, "enabled": 1}, "Charger_YC": {"deviceType":106, "polling":0, "enabled": 1} }, "view": {"latitude":0,"longitude":0,"altitude":0}, diff --git a/src/app/Policy.cpp b/src/app/Policy.cpp index 0febba8..6fa175f 100644 --- a/src/app/Policy.cpp +++ b/src/app/Policy.cpp @@ -151,6 +151,11 @@ void SysPolicy::getGatewayJsonPeriods(njson& json) { int h = 0; int m = 0; PeriodsTimeStrToInt(item.first, h, m); + if (jsonArray.size() == 0 && h!=0) + { + jsonArray.push_back({0, 0, 0}); + } + int p = 1; if (item.second == "谷") p = 1; else if (item.second == "平") p = 2; diff --git a/src/protocol/MqttEntity.cpp b/src/protocol/MqttEntity.cpp index 7913f5f..51e3160 100644 --- a/src/protocol/MqttEntity.cpp +++ b/src/protocol/MqttEntity.cpp @@ -292,7 +292,7 @@ int MqttClient::onMessageArrived(char* topic, int topicLen, MQTTAsync_message* m { int deviceNo = -1; JSON::read(json, "no", deviceNo); - if (command == "Gateway_YC") + if (command == "Gateway_YC" || command == "Gateway_YT") { int mode = -1; std::string param1;