From 11a2d7322e0e4ef213f35280fbe77ca80cb5eb67 Mon Sep 17 00:00:00 2001 From: Rene Nulsch <33263735+ReneNulschDE@users.noreply.github.com> Date: Sat, 3 Aug 2024 11:55:39 +0200 Subject: [PATCH] Mercedes: fix EQV maxSoc (#15215) --- vehicle/mercedes/api.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vehicle/mercedes/api.go b/vehicle/mercedes/api.go index 1ba5546d5..47acfb020 100644 --- a/vehicle/mercedes/api.go +++ b/vehicle/mercedes/api.go @@ -97,6 +97,10 @@ func (v *API) Status(vin string) (StatusResponse, error) { res.EvInfo.Battery.ChargingStatus = 3 } + if val, ok := message.Attributes["maxSoc"]; ok && val != nil { + res.EvInfo.Battery.SocLimit = int(val.GetIntValue()) + } + if val, ok := message.Attributes["selectedChargeProgram"]; ok && val != nil { selectedChargeProgram := val.GetIntValue() res.EvInfo.Battery.SelectedChargeProgram = int(selectedChargeProgram) @@ -108,10 +112,7 @@ func (v *API) Status(vin string) (StatusResponse, error) { } } } - } else { - if val, ok := message.Attributes["maxSoc"]; ok && val != nil { - res.EvInfo.Battery.SocLimit = int(val.GetIntValue()) - } } + return res, err }