From ebf74ab424efc07624e28ffcf400f79d2b52929f Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 8 Dec 2018 09:43:48 +0100 Subject: [PATCH] Update Hass discovery --- sonoff/xdrv_12_home_assistant.ino | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sonoff/xdrv_12_home_assistant.ino b/sonoff/xdrv_12_home_assistant.ino index 2972d39ea..a57de717b 100644 --- a/sonoff/xdrv_12_home_assistant.ino +++ b/sonoff/xdrv_12_home_assistant.ino @@ -345,9 +345,10 @@ void HAssAnnounceSwitches(void) // Check if MQTT message will be ON/OFF or TOGGLE if (Settings.switchmode[switch_index] == FOLLOW || Settings.switchmode[switch_index] == FOLLOW_INV || + Settings.flag3.button_switch_force_local || !strcmp(mqtt_topic, sw_topic) || !strcmp(Settings.mqtt_grptopic, sw_topic)) { - toggle = 0; + toggle = 0; // MQTT message will be ON/OFF } HAssAnnounceButtonSwitch(switch_index, sw_topic, switch_present, 0, toggle); @@ -377,9 +378,10 @@ void HAssAnnounceButtons(void) } // Check if MQTT message will be ON/OFF or TOGGLE - if (!strcmp(mqtt_topic, key_topic) || !strcmp(Settings.mqtt_grptopic, key_topic)) + if (Settings.flag3.button_switch_force_local || + !strcmp(mqtt_topic, key_topic) || !strcmp(Settings.mqtt_grptopic, key_topic)) { - toggle = 0; + toggle = 0; // MQTT message will be ON/OFF } HAssAnnounceButtonSwitch(button_index, key_topic, button_present, 1, toggle);