Go-E: fix panic

This commit is contained in:
andig 2022-01-01 16:14:24 +01:00
parent a39ca3aee1
commit 9d61d98414

View file

@ -184,7 +184,10 @@ var _ api.Identifier = (*GoE)(nil)
// Identify implements the api.Identifier interface
func (c *GoE) Identify() (string, error) {
resp, err := c.api.Status()
return resp.Identify(), err
if err != nil {
return "", err
}
return resp.Identify(), nil
}
// totalEnergy implements the api.MeterEnergy interface - v2 only