Skip to content

Commit

Permalink
Fix state handling and diagnostic messages (#114)
Browse files Browse the repository at this point in the history
andig authored May 8, 2020
1 parent c289179 commit 0ceda8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charger/keba.go
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0ceda8f

Please sign in to comment.