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.
This commit is contained in:
Barbudor
2020-11-14 19:31:38 +01:00
committed by GitHub
parent 5e044dbcc6
commit e6acebf638

View File

@@ -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;
}