mirror of https://github.com/arendst/Tasmota.git
Issue#22535 applying masking window to any power change (#22539)
* apply masking to any power change * stupid typo * rephrase
This commit is contained in:
parent
3ab87273e6
commit
155dea98cd
|
@ -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
|
* Driver initialisation
|
||||||
*/
|
*/
|
||||||
|
@ -173,6 +179,9 @@ bool Xdrv71(uint32_t function) {
|
||||||
//case FUNC_EVERY_250_MSECOND:
|
//case FUNC_EVERY_250_MSECOND:
|
||||||
MagicSwitchLoop();
|
MagicSwitchLoop();
|
||||||
break;
|
break;
|
||||||
|
case FUNC_SET_POWER:
|
||||||
|
MagicSwitchSetPower();
|
||||||
|
break;
|
||||||
case FUNC_ADD_SWITCH:
|
case FUNC_ADD_SWITCH:
|
||||||
result = MagicSwitchAddSwitch();
|
result = MagicSwitchAddSwitch();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue