mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 05:06:44 +00:00
Remove literal string
This commit is contained in:
parent
8d2e0af2f4
commit
e984d49946
@ -297,10 +297,12 @@ static void mqtt_message_cb(char * topic, byte * payload, unsigned int length)
|
|||||||
if(!strcmp_P(topic, PSTR("status"))) { // endsWith status
|
if(!strcmp_P(topic, PSTR("status"))) { // endsWith status
|
||||||
if(!strcasecmp_P((char *)payload, PSTR("OFF"))) {
|
if(!strcasecmp_P((char *)payload, PSTR("OFF"))) {
|
||||||
{
|
{
|
||||||
|
char msg[4];
|
||||||
char tmp_topic[strlen(mqttNodeTopic) + 8];
|
char tmp_topic[strlen(mqttNodeTopic) + 8];
|
||||||
snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstatus"), mqttNodeTopic);
|
snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstatus"), mqttNodeTopic);
|
||||||
bool res = mqttPublish(tmp_topic, "ON"); //, true); // Literal String
|
snprintf_P(msg, sizeof(msg), PSTR("ON"));
|
||||||
mqttResult(res, tmp_topic, "ON");
|
|
||||||
|
bool res = mqttClient.publish(tmp_topic, msg, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user