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() {