diff --git a/src/Globals.cpp b/src/Globals.cpp index b86fc027..867269b4 100644 --- a/src/Globals.cpp +++ b/src/Globals.cpp @@ -65,7 +65,7 @@ IPAddress gateway; IPAddress subnet; IPAddress primaryDNS; IPAddress secondaryDNS; -const char *VERSION = "0.43"; +const char *VERSION = "0.44"; String MQTT_HOST = ""; uint16_t MQTT_PORT = 1883; String MQTT_USER; diff --git a/src/MQTTManager.cpp b/src/MQTTManager.cpp index 3c817171..150da369 100644 --- a/src/MQTTManager.cpp +++ b/src/MQTTManager.cpp @@ -478,7 +478,8 @@ void MQTTManager_::sendButton(byte btn, bool state) case 0: if (btn0State != state) { - btnleft->setState(state, false); + if (HA_DISCOVERY) + btnleft->setState(state, false); btn0State = state; publish(ButtonLeftTopic, state ? State1 : State0); } @@ -486,7 +487,8 @@ void MQTTManager_::sendButton(byte btn, bool state) case 1: if (btn1State != state) { - btnmid->setState(state, false); + if (HA_DISCOVERY) + btnmid->setState(state, false); btn1State = state; publish(ButtonSelectTopic, state ? State1 : State0); } @@ -495,7 +497,8 @@ void MQTTManager_::sendButton(byte btn, bool state) case 2: if (btn2State != state) { - btnright->setState(state, false); + if (HA_DISCOVERY) + btnright->setState(state, false); btn2State = state; publish(ButtonRightTopic, state ? State1 : State0); }