mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-26 04:36:38 +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()) {
|
// if(mqttIsConnected()) {
|
||||||
char tmp_topic[strlen(mqttNodeTopic) + 20];
|
char tmp_topic[strlen(mqttNodeTopic) + 20];
|
||||||
size_t len = snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstate/%s"), mqttNodeTopic, subtopic);
|
snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstate/%s"), mqttNodeTopic, subtopic);
|
||||||
bool res = mqttPublish(tmp_topic, payload, len);
|
bool res = mqttPublish(tmp_topic, payload, strlen(payload));
|
||||||
mqttResult(res, tmp_topic, payload);
|
mqttResult(res, tmp_topic, payload);
|
||||||
// } else {
|
// } else {
|
||||||
// return mqtt_log_no_connection();
|
// return mqtt_log_no_connection();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user