Minor string optimisation.
This commit is contained in:
parent
9e69627626
commit
31efbe915e
@ -271,10 +271,9 @@ void PIRsensorSwitch::publishMqtt(const char* state)
|
|||||||
#ifndef WLED_DISABLE_MQTT
|
#ifndef WLED_DISABLE_MQTT
|
||||||
//Check if MQTT Connected, otherwise it will crash the 8266
|
//Check if MQTT Connected, otherwise it will crash the 8266
|
||||||
if (WLED_MQTT_CONNECTED) {
|
if (WLED_MQTT_CONNECTED) {
|
||||||
char subuf[64];
|
char buf[64];
|
||||||
strcpy(subuf, mqttDeviceTopic);
|
sprintf_P(buf, PSTR("%s/motion"), mqttDeviceTopic); //max length: 33 + 7 = 40
|
||||||
strcat_P(subuf, PSTR("/motion"));
|
mqtt->publish(buf, 0, false, state);
|
||||||
mqtt->publish(subuf, 0, false, state);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user