From 97e8ac19cdf49b3060b15f2168ea57f082996e04 Mon Sep 17 00:00:00 2001 From: roethigj Date: Wed, 26 Nov 2025 17:12:47 +0100 Subject: [PATCH] EEBus: fix failsafe limit not left (#25578) --- hems/eebus/eebus.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hems/eebus/eebus.go b/hems/eebus/eebus.go index fccbc11b4..0fefd5fd5 100644 --- a/hems/eebus/eebus.go +++ b/hems/eebus/eebus.go @@ -172,7 +172,8 @@ func (c *EEBus) Run() { // TODO check state machine against spec func (c *EEBus) run() error { c.mux.RLock() - defer c.mux.RUnlock() + c.mux.Lock() + defer c.mux.Unlock() c.log.TRACE.Println("status:", c.status) @@ -219,7 +220,7 @@ func (c *EEBus) run() error { case StatusFailsafe: // LPC-914/2 - if d := c.failsafeDuration; heartbeatErr == nil && time.Since(c.statusUpdated) > d { + if d := c.failsafeDuration; heartbeatErr == nil || time.Since(c.statusUpdated) > d { c.log.DEBUG.Println("heartbeat returned and failsafe duration exceeded- return to normal") c.setStatusAndLimit(StatusUnlimited, 0) }