From 86be6c8a3da1f4bdc5567cce5bf9ecf9ebc8372c Mon Sep 17 00:00:00 2001 From: stefanbode Date: Sat, 8 Apr 2023 09:40:38 +0200 Subject: [PATCH] Additional limit check on tilt changes (#18364) * limit check on tilt position * limit check on tilt changes --- tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino | 2 +- tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino index ee3a0b961..5b0d8562d 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino @@ -1428,7 +1428,7 @@ void CmndShutterPosition(void) //override tiltposition if explicit set (shutterbutton) if (Shutter[index].tilt_target_pos_override != -128) { - Shutter[index].tilt_target_pos = Shutter[index].tilt_target_pos_override; + Shutter[index].tilt_target_pos = tmin(tmax( Shutter[index].tilt_config[0],Shutter[index].tilt_target_pos_override ), Shutter[index].tilt_config[1]); Shutter[index].tilt_target_pos_override = -128; } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index a763e51e1..18940e681 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -1343,7 +1343,7 @@ void CmndShutterPosition(void) // manual override of tiltposition if (Shutter[index].tilt_target_pos_override != -128) { - Shutter[index].tilt_target_pos = Shutter[index].tilt_target_pos_override; + Shutter[index].tilt_target_pos = tmin(tmax( Shutter[index].tilt_config[0],Shutter[index].tilt_target_pos_override ), Shutter[index].tilt_config[1]); Shutter[index].tilt_target_pos_override = -128; }