Tuya Fix: Dimmer doesn't switch on from HASS

Tuya serial dimmer doesn't switch on from HASS because when powered off, HASS sends dimmer command.
Internally, dimmer update and power command are sent too quickly to serial out and switch doesn't turn on.
Adding a delay fixes things.
This commit is contained in:
Shantur Rathore 2019-08-21 15:31:31 +01:00
parent 9fb804b426
commit 92a6f6672c

View File

@ -139,6 +139,7 @@ bool TuyaSetPower(void)
bool TuyaSetChannels(void)
{
LightSerialDuty(((uint8_t*)XdrvMailbox.data)[0]);
delay(20); // Hack when power is off and dimmer is set then both commands go too soon to Serial out.
return true;
}