From ddb6b02f9196b234dbf536cb4979d1ccfc267775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Wed, 29 Aug 2018 23:56:06 +0200 Subject: [PATCH] Honour build time settings for MQTT on fresh install (#719) --- code/espurna/mqtt.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/espurna/mqtt.ino b/code/espurna/mqtt.ino index b4ec306a..79f4bff7 100644 --- a/code/espurna/mqtt.ino +++ b/code/espurna/mqtt.ino @@ -703,7 +703,6 @@ void mqttUnsubscribe(const char * topic) { void mqttEnabled(bool status) { _mqtt_enabled = status; - setSetting("mqttEnabled", status ? 1 : 0); } bool mqttEnabled() { @@ -736,7 +735,7 @@ void mqttSetBroker(IPAddress ip, unsigned int port) { } void mqttSetBrokerIfNone(IPAddress ip, unsigned int port) { - if (!hasSetting("mqttServer")) mqttSetBroker(ip, port); + if (getSetting("mqttServer", MQTT_SERVER).length() == 0) mqttSetBroker(ip, port); } void mqttReset() {