Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#22535 applying masking window to any power change #22539

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tasmota/tasmota_xdrv_driver/xdrv_71_magic_switch.ino
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ void MagicSwitchLoop()
}
}

void MagicSwitchSetPower(void) {
// It can happen that on relay switch, disturbances on the mains is falsy see as a MagicSwitch pulse
// This restart the masking windows on every power change to avoid that effect
MagicSwitch->switch_state = MAGICSWITCH_MASKING_WINDOW_LEN;
}

/********************************************************************************************************
* Driver initialisation
*/
Expand Down Expand Up @@ -173,6 +179,9 @@ bool Xdrv71(uint32_t function) {
//case FUNC_EVERY_250_MSECOND:
MagicSwitchLoop();
break;
case FUNC_SET_POWER:
MagicSwitchSetPower();
break;
case FUNC_ADD_SWITCH:
result = MagicSwitchAddSwitch();
break;
Expand Down