Mercedes: fix EQV maxSoc (#15215)

This commit is contained in:
Rene Nulsch 2024-08-03 11:55:39 +02:00 • committed by GitHub
parent 03f62e5593
commit 11a2d7322e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}