Skip to content

Commit

Permalink
Issue#22535 applying masking window to any power change (#22539)
Browse files Browse the repository at this point in the history
* apply masking to any power change

* stupid typo

* rephrase
  • Loading branch information
barbudor authored Nov 25, 2024
1 parent 3ab8727 commit 155dea9
Showing 1 changed file with 9 additions and 0 deletions.
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

0 comments on commit 155dea9

Please sign in to comment.