From 156a3551b0f663158c5723f12ddd51c5ece6d00c Mon Sep 17 00:00:00 2001 From: stefanbode Date: Wed, 14 Jun 2023 16:14:10 +0200 Subject: [PATCH] Repair SHUTTER Shelly 2.5 with manual relay change on switches (#18877) * Repair manual relay change * Repair manual relay change --- tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino | 4 ++-- tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino index 1108b3671..e056ce629 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino @@ -1128,14 +1128,14 @@ void ShutterRelayChanged(void) case SHT_COUNTER: case SHT_PWM_VALUE: case SHT_PWM_TIME: + ShutterPowerOff(i); case SHT_TIME: { - ShutterPowerOff(i); // powerstate_local == 0 => direction=0, stop // powerstate_local == 1 => direction=1, target=Shutter[i].open_max // powerstate_local == 2 => direction=-1, target=0 // only happen on SHT_TIME // powerstate_local == 3 => direction=-1, target=0 // only happen if NOT SHT_TIME int8_t direction = (powerstate_local == 0) ? 0 : (powerstate_local == 1) ? 1 : -1; - int8_t target = (powerstate_local == 1) ? Shutter[i].open_max : 0; + int32_t target = (powerstate_local == 1) ? Shutter[i].open_max : 0; if (direction != 0) { ShutterStartInit(i, direction, target); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index 5fb4ae327..76a03da9b 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -893,14 +893,14 @@ void ShutterRelayChanged(void) case SHT_COUNTER: case SHT_PWM_VALUE: case SHT_PWM_TIME: + ShutterPowerOff(i); case SHT_TIME: { - ShutterPowerOff(i); // powerstate_local == 0 => direction=0, stop // powerstate_local == 1 => direction=1, target=Shutter[i].open_max // powerstate_local == 2 => direction=-1, target=0 // only happen on SHT_TIME // powerstate_local == 3 => direction=-1, target=0 // only happen if NOT SHT_TIME int8_t direction = (powerstate_local == 0) ? 0 : (powerstate_local == 1) ? 1 : -1; - int8_t target = (powerstate_local == 1) ? Shutter[i].open_max : 0; + int32_t target = (powerstate_local == 1) ? Shutter[i].open_max : 0; if (direction != 0) { ShutterStartInit(i, direction, target);