From 45377f55dab431a68eb09f50031ba1b930cfd715 Mon Sep 17 00:00:00 2001 From: andig Date: Thu, 10 Oct 2024 20:00:48 +0200 Subject: [PATCH] EEBus: accept pending limits --- hems/eebus/events.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hems/eebus/events.go b/hems/eebus/events.go index 8808047aa..ca3174ef1 100644 --- a/hems/eebus/events.go +++ b/hems/eebus/events.go @@ -112,9 +112,14 @@ func (c *EEBus) dataUpdateLimit() { } func (c *EEBus) writeApprovalRequired() { - for k, v := range c.uc.LPC.PendingConsumptionLimits() { - c.log.DEBUG.Println("LPC.PendingConsumptionLimit:", k, v) - c.uc.LPC.ApproveOrDenyConsumptionLimit(k, false, "not implemented") + for msg, limit := range c.uc.LPC.PendingConsumptionLimits() { + c.log.DEBUG.Println("LPC.PendingConsumptionLimit:", msg, limit) + c.uc.LPC.ApproveOrDenyConsumptionLimit(msg, true, "") + + c.mux.Lock() + defer c.mux.Unlock() + + c.consumptionLimit = &limit } }