From 8a29adfa8b51178f86aed2cbe7b5f858867370d7 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Mon, 14 Dec 2020 18:08:13 +0100 Subject: [PATCH 1/2] #9906 fixed reporting now also after manual relay change --- tasmota/xdrv_27_shutter.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index 50dcd970a..6134af962 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -616,7 +616,7 @@ void ShutterRelayChanged(void) break; default: TasmotaGlobal.last_source = SRC_SHUTTER; // avoid switch off in the next loop - if (Shutter[i].direction != 0 ) ShutterPowerOff(i); + if (Shutter[i].direction != 0 ) ShutterUpdatePosition(); } switch (ShutterGlobal.position_mode) { // enum Shutterposition_mode {SHT_TIME, SHT_TIME_UP_DOWN, SHT_TIME_GARAGE, SHT_COUNTER, SHT_PWM_VALUE, SHT_PWM_TIME,}; From 48bc3c9409869525ce88a09ebeacd9c84afd284c Mon Sep 17 00:00:00 2001 From: stefanbode Date: Mon, 14 Dec 2020 18:23:01 +0100 Subject: [PATCH 2/2] update Motordelay stop issue ##10033 reorder stop to esure direct stop after command --- tasmota/xdrv_27_shutter.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index 6134af962..d20c7700a 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -430,10 +430,6 @@ void ShutterDecellerateForStop(uint8_t i) void ShutterPowerOff(uint8_t i) { AddLog_P(LOG_LEVEL_DEBUG, PSTR("SHT: Stop Shutter %d. Switchmode %d"), i,Shutter[i].switch_mode); ShutterDecellerateForStop(i); - if (Shutter[i].direction !=0) { - Shutter[i].direction = 0; - delay(MOTOR_STOP_TIME); - } switch (Shutter[i].switch_mode) { case SHT_SWITCH: if ((1 << (Settings.shutter_startrelay[i]-1)) & TasmotaGlobal.power) { @@ -465,6 +461,10 @@ void ShutterPowerOff(uint8_t i) { ExecuteCommand(scmnd, SRC_BUTTON); break; } + if (Shutter[i].direction !=0) { + Shutter[i].direction = 0; + delay(MOTOR_STOP_TIME); + } } void ShutterUpdatePosition(void)