Skip to content

Commit 155dea9

Browse files
authored
Issue#22535 applying masking window to any power change (#22539)
* apply masking to any power change * stupid typo * rephrase
1 parent 3ab8727 commit 155dea9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: tasmota/tasmota_xdrv_driver/xdrv_71_magic_switch.ino

+9
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ void MagicSwitchLoop()
105105
}
106106
}
107107

108+
void MagicSwitchSetPower(void) {
109+
// It can happen that on relay switch, disturbances on the mains is falsy see as a MagicSwitch pulse
110+
// This restart the masking windows on every power change to avoid that effect
111+
MagicSwitch->switch_state = MAGICSWITCH_MASKING_WINDOW_LEN;
112+
}
113+
108114
/********************************************************************************************************
109115
* Driver initialisation
110116
*/
@@ -173,6 +179,9 @@ bool Xdrv71(uint32_t function) {
173179
//case FUNC_EVERY_250_MSECOND:
174180
MagicSwitchLoop();
175181
break;
182+
case FUNC_SET_POWER:
183+
MagicSwitchSetPower();
184+
break;
176185
case FUNC_ADD_SWITCH:
177186
result = MagicSwitchAddSwitch();
178187
break;

0 commit comments

Comments
 (0)