修改Gateway_YT消息的订阅的解析

This commit is contained in:
lixiaoyuan
2025-10-14 09:28:25 +08:00
parent b317a03f35
commit 5f6511a3f0
3 changed files with 7 additions and 1 deletions

View File

@@ -26,6 +26,7 @@
"Cooling_YX": {"deviceType":14, "polling":1, "enabled": 1}, "Cooling_YX": {"deviceType":14, "polling":1, "enabled": 1},
"Gateway_YX": {"deviceType":15, "polling":1, "enabled": 1}, "Gateway_YX": {"deviceType":15, "polling":1, "enabled": 1},
"Gateway_YC": {"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} "Charger_YC": {"deviceType":106, "polling":0, "enabled": 1}
}, },
"view": {"latitude":0,"longitude":0,"altitude":0}, "view": {"latitude":0,"longitude":0,"altitude":0},

View File

@@ -151,6 +151,11 @@ void SysPolicy::getGatewayJsonPeriods(njson& json)
{ {
int h = 0; int m = 0; int h = 0; int m = 0;
PeriodsTimeStrToInt(item.first, h, m); PeriodsTimeStrToInt(item.first, h, m);
if (jsonArray.size() == 0 && h!=0)
{
jsonArray.push_back({0, 0, 0});
}
int p = 1; int p = 1;
if (item.second == "") p = 1; if (item.second == "") p = 1;
else if (item.second == "") p = 2; else if (item.second == "") p = 2;

View File

@@ -292,7 +292,7 @@ int MqttClient::onMessageArrived(char* topic, int topicLen, MQTTAsync_message* m
{ {
int deviceNo = -1; int deviceNo = -1;
JSON::read(json, "no", deviceNo); JSON::read(json, "no", deviceNo);
if (command == "Gateway_YC") if (command == "Gateway_YC" || command == "Gateway_YT")
{ {
int mode = -1; int mode = -1;
std::string param1; std::string param1;