building flags & small bugfix (MQTT&TOGGLE)

This commit is contained in:
2020-07-14 01:54:42 +03:00
parent fb6bb153ba
commit 10a9bb119d
8 changed files with 34 additions and 17 deletions

View File

@@ -959,7 +959,7 @@ if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,emit->valuestri
else if (strlen(scmd->valuestring))
mqttClient.publish(addrstr, scmd->valuestring, true);
} else { //send reset command
if (!rcmd || rcmd->type == aJson_String) mqttClient.publish(addrstr, "OFF", true);
if (!rcmd || rcmd->type != aJson_String) mqttClient.publish(addrstr, "OFF", true);
else if (strlen(rcmd->valuestring))mqttClient.publish(addrstr, rcmd->valuestring, true);
}
}