diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino index 283be9951..2a028bb97 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino @@ -1868,12 +1868,10 @@ void CmndShutterPosition(void) } int8_t target_pos_percent = (XdrvMailbox.payload < 0) ? (XdrvMailbox.payload == -99 ? ShutterRealToPercentPosition(Shutter[index].real_position, index) : 0) : ((XdrvMailbox.payload > 100) ? 100 : XdrvMailbox.payload); - target_pos_percent = ((ShutterSettings.shutter_options[index] & 1) && ((SRC_MQTT != TasmotaGlobal.last_source) // 1 - && (SRC_SERIAL != TasmotaGlobal.last_source) // 6 - && (SRC_WEBGUI != TasmotaGlobal.last_source) // 7 - && (SRC_WEBCOMMAND != TasmotaGlobal.last_source) // 8 - )) ? 100 - target_pos_percent : target_pos_percent; - + target_pos_percent = ((ShutterSettings.shutter_options[index] & 1) && ( (SRC_SERIAL != TasmotaGlobal.last_source) // 6 + && (SRC_WEBGUI != TasmotaGlobal.last_source) // 7 + && (SRC_WEBCOMMAND != TasmotaGlobal.last_source) // 8 + )) ? 100 - target_pos_percent : target_pos_percent; // if position is either 0 or 100 reset the tilt to avoid tilt moving at the end if (target_pos_percent == 0 && ShutterRealToPercentPosition(Shutter[index].real_position, index) > 0 ) {Shutter[index].tilt_target_pos = Shutter[index].tilt_config[4];} if (target_pos_percent == 100 && ShutterRealToPercentPosition(Shutter[index].real_position, index) < 100) {Shutter[index].tilt_target_pos = Shutter[index].tilt_config[3];} diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index db1f622fb..776f08a74 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -1332,11 +1332,10 @@ void CmndShutterPosition(void) } int8_t target_pos_percent = (XdrvMailbox.payload < 0) ? (XdrvMailbox.payload == -99 ? ShutterRealToPercentPosition(Shutter[index].real_position, index) : 0) : ((XdrvMailbox.payload > 100) ? 100 : XdrvMailbox.payload); - target_pos_percent = ((Settings->shutter_options[index] & 1) && ((SRC_MQTT != TasmotaGlobal.last_source) - && (SRC_SERIAL != TasmotaGlobal.last_source) - && (SRC_WEBGUI != TasmotaGlobal.last_source) - && (SRC_WEBCOMMAND != TasmotaGlobal.last_source) - )) ? 100 - target_pos_percent : target_pos_percent; + target_pos_percent = ((Settings->shutter_options[index] & 1) && ( (SRC_SERIAL != TasmotaGlobal.last_source) + && (SRC_WEBGUI != TasmotaGlobal.last_source) + && (SRC_WEBCOMMAND != TasmotaGlobal.last_source) + )) ? 100 - target_pos_percent : target_pos_percent; // if position is either 0 or 100 reset the tilt to avoid tilt moving at the end if (target_pos_percent == 0 && ShutterRealToPercentPosition(Shutter[index].real_position, index) > 0 ) {Shutter[index].tilt_target_pos = Shutter[index].tilt_config[4];}