From 8c629ba7ab1e0a915f230a40d730769270379b7b Mon Sep 17 00:00:00 2001 From: Maciej Czerniak Date: Wed, 7 Feb 2018 23:32:01 +0100 Subject: [PATCH] hack for correctly restoring relay state on boot - because of broken stm firmware --- code/espurna/relay.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/espurna/relay.ino b/code/espurna/relay.ino index abaf83cf..02012df2 100644 --- a/code/espurna/relay.ino +++ b/code/espurna/relay.ino @@ -394,7 +394,11 @@ void _relayBoot() { } _relays[i].current_status = !status; _relays[i].target_status = status; - _relays[i].change_time = millis(); + #ifdef RELAY_PROVIDER_STM + _relays[i].change_time = millis() + 3000 + 1000 * i; + #else + _relays[i].change_time = millis(); + #endif bit <<= 1; }