From 4bea3c7fcb9953ff6acc8e4945125c99d3552b6c Mon Sep 17 00:00:00 2001 From: Andreas Linde <42185+DerAndereAndi@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:57:55 +0200 Subject: [PATCH] EEBUS: ignore EVSEs not providing current limits (#15299) Some EVSEs using EEBUS sometimes do not provide any current charging limits and also do not provide valid ranges just ignore these scenarios and hope for the best. --- charger/eebus.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charger/eebus.go b/charger/eebus.go index d1a34b756..515722799 100644 --- a/charger/eebus.go +++ b/charger/eebus.go @@ -356,13 +356,13 @@ func (c *EEBus) writeCurrentLimitData(currents []float64) error { _, maxLimits, _, err := c.uc.OpEV.CurrentLimits(evEntity) if err != nil { - return errors.New("no limits available") + c.log.DEBUG.Println("no limits from the EVSE are provided:", err) } // setup the limit data structure limits := []ucapi.LoadLimitsPhase{} for phase, current := range currents { - if phase >= len(maxLimits) || phase >= len(ucapi.PhaseNameMapping) { + if phase >= len(ucapi.PhaseNameMapping) { continue } @@ -373,7 +373,7 @@ func (c *EEBus) writeCurrentLimitData(currents []float64) error { } // if the limit equals to the max allowed, then the obligation limit is actually inactive - if current >= maxLimits[phase] { + if phase < len(maxLimits) && current >= maxLimits[phase] { limit.IsActive = false }