mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 19:56:30 +00:00
Merge pull request #10141 from stefanbode/patch-6
Shutters: Correct Pulsetime issues.
This commit is contained in:
commit
6a38269ae9
@ -445,7 +445,7 @@ void ShutterPowerOff(uint8_t i) {
|
|||||||
if ((SRC_PULSETIMER == TasmotaGlobal.last_source || SRC_SHUTTER == TasmotaGlobal.last_source || SRC_WEBGUI == TasmotaGlobal.last_source)) {
|
if ((SRC_PULSETIMER == TasmotaGlobal.last_source || SRC_SHUTTER == TasmotaGlobal.last_source || SRC_WEBGUI == TasmotaGlobal.last_source)) {
|
||||||
ExecuteCommandPowerShutter(cur_relay, 1, SRC_SHUTTER);
|
ExecuteCommandPowerShutter(cur_relay, 1, SRC_SHUTTER);
|
||||||
// switch off direction relay to make it power less
|
// switch off direction relay to make it power less
|
||||||
if ((1 << (Settings.shutter_startrelay[i])) & TasmotaGlobal.power) {
|
if (((1 << (Settings.shutter_startrelay[i])) & TasmotaGlobal.power) && Settings.shutter_startrelay[i]+1 != cur_relay) {
|
||||||
ExecuteCommandPowerShutter(Settings.shutter_startrelay[i]+1, 0, SRC_SHUTTER);
|
ExecuteCommandPowerShutter(Settings.shutter_startrelay[i]+1, 0, SRC_SHUTTER);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -616,7 +616,7 @@ void ShutterRelayChanged(void)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
TasmotaGlobal.last_source = SRC_SHUTTER; // avoid switch off in the next loop
|
TasmotaGlobal.last_source = SRC_SHUTTER; // avoid switch off in the next loop
|
||||||
if (Shutter[i].direction != 0 ) ShutterUpdatePosition();
|
if (Shutter[i].direction != 0 ) Shutter[i].target_position = Shutter[i].real_position;
|
||||||
}
|
}
|
||||||
switch (ShutterGlobal.position_mode) {
|
switch (ShutterGlobal.position_mode) {
|
||||||
// enum Shutterposition_mode {SHT_TIME, SHT_TIME_UP_DOWN, SHT_TIME_GARAGE, SHT_COUNTER, SHT_PWM_VALUE, SHT_PWM_TIME,};
|
// enum Shutterposition_mode {SHT_TIME, SHT_TIME_UP_DOWN, SHT_TIME_GARAGE, SHT_COUNTER, SHT_PWM_VALUE, SHT_PWM_TIME,};
|
||||||
@ -983,7 +983,7 @@ void CmndShutterStop(void)
|
|||||||
AddLog_P(LOG_LEVEL_DEBUG, PSTR("SHT: Stop moving %d: dir: %d"), XdrvMailbox.index, Shutter[i].direction);
|
AddLog_P(LOG_LEVEL_DEBUG, PSTR("SHT: Stop moving %d: dir: %d"), XdrvMailbox.index, Shutter[i].direction);
|
||||||
|
|
||||||
int32_t temp_realpos = ShutterCalculatePosition(i);
|
int32_t temp_realpos = ShutterCalculatePosition(i);
|
||||||
XdrvMailbox.payload = ShutterRealToPercentPosition(temp_realpos, i);
|
XdrvMailbox.payload = ShutterRealToPercentPosition(temp_realpos, i)-Shutter[i].direction;
|
||||||
TasmotaGlobal.last_source = SRC_WEBGUI;
|
TasmotaGlobal.last_source = SRC_WEBGUI;
|
||||||
CmndShutterPosition();
|
CmndShutterPosition();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user