From b287d0509875347ec200440de405d99de82d60f6 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Tue, 4 Apr 2023 17:45:33 +0200 Subject: [PATCH] Enable motordelay for tilt operations (#18330) * implement motordelay also for tilt operations * enable motordelay for tilt operations * Update xdrv_27_esp32_shutter.ino --- 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 a2d6e8627..893f37eff 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino @@ -977,8 +977,8 @@ int32_t ShutterCalculatePosition(uint32_t i) case SHT_TIME_UP_DOWN: case SHT_TIME_GARAGE: if (Shutter[i].tilt_config[2] > 0) { - if (Shutter[i].time <= Shutter[i].venetian_delay) { - Shutter[i].tilt_real_pos = (Shutter[i].tilt_start_pos + ((Shutter[i].direction * (int16_t)Shutter[i].time * (Shutter[i].tilt_config[1]-Shutter[i].tilt_config[0])) / Shutter[i].tilt_config[2])); + if (Shutter[i].time <= Shutter[i].venetian_delay+Shutter[i].motordelay) { + Shutter[i].tilt_real_pos = (Shutter[i].tilt_start_pos + ((Shutter[i].direction * (int16_t)(Shutter[i].time - tmin(Shutter[i].motordelay, Shutter[i].time)) * (Shutter[i].tilt_config[1]-Shutter[i].tilt_config[0])) / Shutter[i].tilt_config[2])); } else { Shutter[i].tilt_real_pos = Shutter[i].direction == 1 ? Shutter[i].tilt_config[1] : Shutter[i].tilt_config[0]; } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index 0202d6756..81ede1e77 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -815,8 +815,8 @@ int32_t ShutterCalculatePosition(uint32_t i) case SHT_TIME_UP_DOWN: case SHT_TIME_GARAGE: if (Shutter[i].tilt_config[2] > 0) { - if (Shutter[i].time <= Shutter[i].venetian_delay) { - Shutter[i].tilt_real_pos = (Shutter[i].tilt_start_pos + ((Shutter[i].direction * (int16_t)Shutter[i].time * (Shutter[i].tilt_config[1]-Shutter[i].tilt_config[0])) / Shutter[i].tilt_config[2])); + if (Shutter[i].time <= Shutter[i].venetian_delay+Shutter[i].motordelay) { + Shutter[i].tilt_real_pos = (Shutter[i].tilt_start_pos + ((Shutter[i].direction * (int16_t)(Shutter[i].time - tmin(Shutter[i].motordelay, Shutter[i].time)) * (Shutter[i].tilt_config[1]-Shutter[i].tilt_config[0])) / Shutter[i].tilt_config[2])); } else { Shutter[i].tilt_real_pos = Shutter[i].direction == 1 ? Shutter[i].tilt_config[1] : Shutter[i].tilt_config[0]; }