Skip to content

Commit

Permalink
Fixed HA autodiscovery and MQTT ON
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Mar 27, 2019
1 parent 1a3b4ac commit 3ffb40f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion wled00/wled00.ino
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@


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


Expand Down
6 changes: 2 additions & 4 deletions wled00/wled17_mqtt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -45,9 +45,7 @@ void onMqttConnect(bool sessionPresent)
mqtt->subscribe(subuf, 0);
}

#ifdef WLED_ENABLE_HOMEASSISTANT_AUTODISCOVERY
sendHADiscoveryMQTT();
#endif
publishMqtt();
}

Expand Down

0 comments on commit 3ffb40f

Please sign in to comment.