Fixed HA autodiscovery and MQTT ON

This commit is contained in:
cschwinne 2019-03-27 21:31:59 +01:00
parent 1a3b4ac2ac
commit 3ffb40fafa
2 changed files with 3 additions and 5 deletions

View File

@ -98,7 +98,7 @@
//version code in format yymmddb (b = daily build)
#define VERSION 1903271
#define VERSION 1903272
char versionString[] = "0.8.4";

View File

@ -6,8 +6,8 @@
void parseMQTTBriPayload(char* payload)
{
if (strcmp(payload, "ON") == 0 || strcmp(payload, "on") == 0) {bri = briLast; colorUpdated(1);}
else if (strcmp(payload, "T" ) == 0 || strcmp(payload, "t" ) == 0) {toggleOnOff(); colorUpdated(1);}
if (strstr(payload, "ON") || strstr(payload, "on")) {bri = briLast; colorUpdated(1);}
else if (strstr(payload, "T" ) || strstr(payload, "t" )) {toggleOnOff(); colorUpdated(1);}
else {
uint8_t in = strtoul(payload, NULL, 10);
if (in == 0 && bri > 0) briLast = bri;
@ -45,9 +45,7 @@ void onMqttConnect(bool sessionPresent)
mqtt->subscribe(subuf, 0);
}
#ifdef WLED_ENABLE_HOMEASSISTANT_AUTODISCOVERY
sendHADiscoveryMQTT();
#endif
publishMqtt();
}