chore: add disconnected state
This commit is contained in:
parent
f0f7742f53
commit
68b2150328
1 changed files with 3 additions and 1 deletions
|
|
@ -56,11 +56,13 @@ var _ api.ChargeState = (*Provider)(nil)
|
|||
|
||||
// Status implements the api.ChargeState interface
|
||||
func (v *Provider) Status() (api.ChargeStatus, error) {
|
||||
status := api.StatusA // disconnected
|
||||
status := api.StatusNone
|
||||
|
||||
res, err := v.statusG()
|
||||
if err == nil {
|
||||
switch res.Metrics.XevPlugChargerStatus.Value {
|
||||
case "DISCONNECTED":
|
||||
status = api.StatusA // disconnected
|
||||
case "CONNECTED":
|
||||
status = api.StatusB // connected, not charging
|
||||
case "CHARGING", "CHARGINGAC":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue