mirror of https://github.com/arendst/Tasmota.git
Avoid ghost switching in position 0 and 100
confirming the position and setting the tilt in 0 and 100% causes ghost switching of the relays. #16435
This commit is contained in:
parent
9d9d46db9c
commit
35475d9353
|
@ -1212,8 +1212,8 @@ void CmndShutterPosition(void)
|
|||
}
|
||||
|
||||
// if position is either 0 or 100 reset the tilt to avoid tilt moving at the end
|
||||
if (XdrvMailbox.payload == 0) {Shutter[index].tilt_target_pos = Shutter[index].tilt_config[4];}
|
||||
if (XdrvMailbox.payload == 100) {Shutter[index].tilt_target_pos = Shutter[index].tilt_config[3];}
|
||||
if (XdrvMailbox.payload == 0 && ShutterRealToPercentPosition(Shutter[index].real_position, index) > 0 ) {Shutter[index].tilt_target_pos = Shutter[index].tilt_config[4];}
|
||||
if (XdrvMailbox.payload == 100 && ShutterRealToPercentPosition(Shutter[index].real_position, index) < 100) {Shutter[index].tilt_target_pos = Shutter[index].tilt_config[3];}
|
||||
|
||||
int8_t target_pos_percent = (XdrvMailbox.payload < 0) ? (XdrvMailbox.payload == -99 ? ShutterRealToPercentPosition(Shutter[index].real_position, index) : 0) : ((XdrvMailbox.payload > 100) ? 100 : XdrvMailbox.payload);
|
||||
// webgui still send also on inverted shutter the native position.
|
||||
|
|
Loading…
Reference in New Issue