EEBus: return not available when disconnected (#15580)

This commit is contained in:
andig 2024-08-21 19:21:09 +02:00 • committed by GitHub
parent 81f3a1cc46
commit de80adbb5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -581,11 +581,11 @@ func (c *EEBus) Identify() (string, error) {
var _ api.Battery = (*EEBus)(nil)
// Soc implements the api.Vehicle interface
// Soc implements the api.Battery interface
func (c *EEBus) Soc() (float64, error) {
evEntity, ok := c.isEvConnected()
if !ok {
return 0, nil
return 0, api.ErrNotAvailable
}
if !c.uc.EvSoc.IsScenarioAvailableAtEntity(evEntity, 1) {