From 0cd46f932ab46ed701101617082c7bbc355ec287 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Fri, 25 Oct 2019 15:32:09 +0200 Subject: [PATCH] Fix 2.4.0 --- wled00/wled00.ino | 16 ++++++++-------- wled00/wled05_init.ino | 21 ++++++--------------- wled00/wled17_mqtt.ino | 5 +++-- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 19835f28f..c484b2167 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -30,21 +30,21 @@ //#define WLED_ENABLE_FS_EDITOR //enable /edit page for editing SPIFFS content. Will also be disabled with OTA lock //to toggle usb serial debug (un)comment the following line -//#define WLED_DEBUG +#define WLED_DEBUG //library inclusions #include -#ifdef ARDUINO_ARCH_ESP32 +#ifdef ESP8266 + #include + #include + #include +#else #include #include "esp_wifi.h" #include #include #include "SPIFFS.h" -#else - #include - #include - #include #endif #include @@ -100,7 +100,7 @@ //version code in format yymmddb (b = daily build) -#define VERSION 1910252 +#define VERSION 1910253 char versionString[] = "0.8.6"; @@ -162,7 +162,7 @@ byte briMultiplier = 100; //% of brightness to set (to limit //User Interface CONFIG char serverDescription[33] = "WLED"; //Name of module byte currentTheme = 7; //UI theme index for settings and classic UI -byte uiConfiguration = 0; //0: automatic (depends on user-agent) 1: classic UI 2: mobile UI +byte uiConfiguration = 2; //0: automatic (depends on user-agent) 1: classic UI 2: mobile UI bool useHSB = true; //classic UI: use HSB sliders instead of RGB by default char cssFont[33] = "Verdana"; //font to use in classic UI diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index abf49639b..62c80fa92 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -205,27 +205,18 @@ void initInterfaces() { if (alexaEnabled) alexaInit(); #ifndef WLED_DISABLE_OTA - #ifdef ESP8266 - if (aOtaEnabled) ArduinoOTA.begin(false); - #else - ArduinoOTA.setMdnsEnabled(false); - if (aOtaEnabled) ArduinoOTA.begin(); - #endif + if (aOtaEnabled) ArduinoOTA.begin(); #endif strip.service(); // Set up mDNS responder: if (strlen(cmDNS) > 0) { - if (MDNS.begin(cmDNS)) - { - DEBUG_PRINTLN("mDNS started"); - MDNS.addService("http", "tcp", 80); - MDNS.addService("wled", "tcp", 80); - if (aOtaEnabled) MDNS.enableArduino(8266); - } else { - DEBUG_PRINTLN("mDNS failed!"); - } + if (!aOtaEnabled) MDNS.begin(cmDNS); + + DEBUG_PRINTLN("mDNS started"); + MDNS.addService("http", "tcp", 80); + MDNS.addService("wled", "tcp", 80); } server.begin(); diff --git a/wled00/wled17_mqtt.ino b/wled00/wled17_mqtt.ino index 9f4ecd42b..d0511c664 100644 --- a/wled00/wled17_mqtt.ino +++ b/wled00/wled17_mqtt.ino @@ -106,7 +106,7 @@ void sendHADiscoveryMQTT() #if ARDUINO_ARCH_ESP32 || LEDPIN != 3 /* -YYYY is discovery tipic +YYYY is device topic XXXX is device name Send out HA MQTT Discovery message on MQTT connect (~2.4kB): @@ -212,7 +212,8 @@ Send out HA MQTT Discovery message on MQTT connect (~2.4kB): strcpy(pubt, "homeassistant/light/"); strcat(pubt, mqttClientID); strcat(pubt, "/config"); - DEBUG_PRINTLN(mqtt->publish(pubt, 0, true, buffer)); + bool success = mqtt->publish(pubt, 0, true, buffer); + DEBUG_PRINTLN(success); #endif }