Fix state handling and diagnostic messages (#114)

This commit is contained in:
andig 2020-05-08 16:20:53 +02:00 • committed by GitHub
parent c28917924d
commit 0ceda8fe5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,7 +152,7 @@ func (c *Keba) Status() (api.ChargeStatus, error) {
return api.StatusA, err
}
if kr.Plug == 0 {
if kr.Plug < 5 {
return api.StatusA, nil
}
if kr.State == 2 {
@ -162,7 +162,7 @@ func (c *Keba) Status() (api.ChargeStatus, error) {
return api.StatusC, nil
}
return api.StatusA, fmt.Errorf("unexpected status: %v", kr)
return api.StatusA, fmt.Errorf("unexpected status: %+v", kr)
}
// Enabled implements the Charger.Enabled interface