From e6acebf638decf91d0811b2d8f23f04f23eaafa2 Mon Sep 17 00:00:00 2001 From: Barbudor Date: Sat, 14 Nov 2020 19:31:38 +0100 Subject: [PATCH] Fix switchmode 15 publish old switch state The forced MqttPublishSensor() was send an immediate SENSOR message with the switch's last_state. So the last_state must be updated before the SENSOR message is sent. --- tasmota/support_switch.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/tasmota/support_switch.ino b/tasmota/support_switch.ino index ad68ba5bf..84755b54d 100644 --- a/tasmota/support_switch.ino +++ b/tasmota/support_switch.ino @@ -404,6 +404,7 @@ void SwitchHandler(uint32_t mode) { } break; case PUSH_IGNORE: + Switch.last_state[i] = button; // Update switch state before publishing MqttPublishSensor(); break; }