Skip to content

Commit

Permalink
fix shutterinvert (#19341)
Browse files Browse the repository at this point in the history
* fix shutterinvert

* fix shutterinvert
  • Loading branch information
stefanbode authored Aug 18, 2023
1 parent 2eaa0fc commit 7927c98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1515,8 +1515,9 @@ 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_WEBCOMMAND != 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;

if (XdrvMailbox.payload != -99) {
Expand Down
5 changes: 3 additions & 2 deletions tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1340,8 +1340,9 @@ 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_WEBCOMMAND != 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;
if (XdrvMailbox.payload != -99) {
//target_pos_percent = (Settings->shutter_options[index] & 1) ? 100 - target_pos_percent : target_pos_percent;
Expand Down

0 comments on commit 7927c98

Please sign in to comment.