From d029d8bcbcf2391c7e7c58e68871ba7ac2671787 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 8 Feb 2023 17:08:13 +0100 Subject: [PATCH] Fix Shelly Pro 4PM switch states --- tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro.ino b/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro.ino index cb1d91a49..b9b6020b4 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_88_esp32_shelly_pro.ino @@ -252,7 +252,7 @@ bool ShellyProAddSwitch(void) { uint32_t index = XdrvMailbox.index - SPro.switch_offset; if (index > 3) { return false; } // Support four switches uint32_t state = bitRead(SPro.input_state, sp4_switch_pin[index]); // 0 on power on and restart - XdrvMailbox.index = state ^1; // Invert + XdrvMailbox.index = state; return true; } @@ -276,7 +276,7 @@ void ShellyProUpdateIsr(void) { for (uint32_t i = 0; i < 4; i++) { if (j == sp4_switch_pin[i]) { - SwitchSetVirtualPinState(SPro.switch_offset +i, state ^1); // Invert + SwitchSetVirtualPinState(SPro.switch_offset +i, state); } else if ((i < 3) && (j == sp4_button_pin[i])) { ButtonSetVirtualPinState(SPro.button_offset +i, state);