diff --git a/hems/eebus/events.go b/hems/eebus/events.go index 954746ff2..346cecc0b 100644 --- a/hems/eebus/events.go +++ b/hems/eebus/events.go @@ -114,12 +114,16 @@ func (c *EEBus) dataUpdateLimit() { func (c *EEBus) writeApprovalRequired() { for msg, limit := range c.cs.CsLPCInterface.PendingConsumptionLimits() { c.log.DEBUG.Println("CS LPC PendingConsumptionLimit:", msg, limit) + if limit.Value < 0 { + c.cs.CsLPCInterface.ApproveOrDenyConsumptionLimit(msg, false, "negative limit") + continue + } + c.cs.CsLPCInterface.ApproveOrDenyConsumptionLimit(msg, true, "") c.mux.Lock() - defer c.mux.Unlock() - c.consumptionLimit = &limit + c.mux.Unlock() } }