Merge pull request #10135 from stefanbode/patch-5

#9906 fixed
This commit is contained in:
Theo Arends 2020-12-14 18:37:09 +01:00 committed by GitHub
commit a4fc57e2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -430,10 +430,6 @@ void ShutterDecellerateForStop(uint8_t i)
void ShutterPowerOff(uint8_t i) {
AddLog_P(LOG_LEVEL_DEBUG, PSTR("SHT: Stop Shutter %d. Switchmode %d"), i,Shutter[i].switch_mode);
ShutterDecellerateForStop(i);
if (Shutter[i].direction !=0) {
Shutter[i].direction = 0;
delay(MOTOR_STOP_TIME);
}
switch (Shutter[i].switch_mode) {
case SHT_SWITCH:
if ((1 << (Settings.shutter_startrelay[i]-1)) & TasmotaGlobal.power) {
@ -465,6 +461,10 @@ void ShutterPowerOff(uint8_t i) {
ExecuteCommand(scmnd, SRC_BUTTON);
break;
}
if (Shutter[i].direction !=0) {
Shutter[i].direction = 0;
delay(MOTOR_STOP_TIME);
}
}
void ShutterUpdatePosition(void)
@ -616,7 +616,7 @@ void ShutterRelayChanged(void)
break;
default:
TasmotaGlobal.last_source = SRC_SHUTTER; // avoid switch off in the next loop
if (Shutter[i].direction != 0 ) ShutterPowerOff(i);
if (Shutter[i].direction != 0 ) ShutterUpdatePosition();
}
switch (ShutterGlobal.position_mode) {
// enum Shutterposition_mode {SHT_TIME, SHT_TIME_UP_DOWN, SHT_TIME_GARAGE, SHT_COUNTER, SHT_PWM_VALUE, SHT_PWM_TIME,};