From 3ffb40fafa75c74cadfeb25c92e4406bb3e90676 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Wed, 27 Mar 2019 21:31:59 +0100 Subject: [PATCH] Fixed HA autodiscovery and MQTT ON --- wled00/wled00.ino | 2 +- wled00/wled17_mqtt.ino | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 259cbd9f..08d1a9b2 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -98,7 +98,7 @@ //version code in format yymmddb (b = daily build) -#define VERSION 1903271 +#define VERSION 1903272 char versionString[] = "0.8.4"; diff --git a/wled00/wled17_mqtt.ino b/wled00/wled17_mqtt.ino index 55cec148..4d018803 100644 --- a/wled00/wled17_mqtt.ino +++ b/wled00/wled17_mqtt.ino @@ -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(); }