mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Fix mqtt publish length bug
This commit is contained in:
parent
a3b358f738
commit
bea980056a
@ -154,8 +154,8 @@ void IRAM_ATTR mqtt_send_state(const __FlashStringHelper * subtopic, const char
|
||||
|
||||
// if(mqttIsConnected()) {
|
||||
char tmp_topic[strlen(mqttNodeTopic) + 20];
|
||||
size_t len = snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstate/%s"), mqttNodeTopic, subtopic);
|
||||
bool res = mqttPublish(tmp_topic, payload, len);
|
||||
snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstate/%s"), mqttNodeTopic, subtopic);
|
||||
bool res = mqttPublish(tmp_topic, payload, strlen(payload));
|
||||
mqttResult(res, tmp_topic, payload);
|
||||
// } else {
|
||||
// return mqtt_log_no_connection();
|
||||
|
Loading…
x
Reference in New Issue
Block a user