From d0f463761105ae11439bbdce1105f54494cbc775 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Thu, 16 Mar 2023 14:38:04 +0100 Subject: [PATCH] Fix #18198 (#18204) * Fix #18198 Fix wrong movement with tilt if additional endstop defined * simplify --- tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index 235cdc8b8..991573d53 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -1274,8 +1274,8 @@ void CmndShutterPosition(void) (abs(Shutter[index].target_position - Shutter[index].real_position ) > Shutter[index].min_realPositionChange || abs(Shutter[index].tilt_target_pos - Shutter[index].tilt_real_pos ) > Shutter[index].min_TiltChange) ) { if (Settings->shutter_options[index] & 4) { - if (0 == target_pos_percent) Shutter[index].target_position -= 1 * RESOLUTION * STEPS_PER_SECOND; - if (100 == target_pos_percent) Shutter[index].target_position += 1 * RESOLUTION * STEPS_PER_SECOND; + if (0 == target_pos_percent && Shutter[index].real_position > 0) Shutter[index].target_position -= 1 * RESOLUTION * STEPS_PER_SECOND; + if (100 == target_pos_percent && Shutter[index].real_position < Shutter[index].open_max) Shutter[index].target_position += 1 * RESOLUTION * STEPS_PER_SECOND; } int8_t new_shutterdirection; if (abs(Shutter[index].target_position - Shutter[index].real_position ) > Shutter[index].min_realPositionChange) {