Skip to content

Commit

Permalink
cli/charger: add status reason
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Sep 6, 2024
1 parent 7626bab commit 789038c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/dumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ func (d *dumper) Dump(name string, v interface{}) {
}
}

if v, ok := v.(api.StatusReasoner); ok {
if status, err := v.StatusReason(); err != nil {
fmt.Fprintf(w, "Status reason:\t%v\n", err)
} else {
fmt.Fprintf(w, "Status reason:\t%v\n", status)
}
}

// controllable battery
if _, ok := v.(api.BatteryController); ok {
fmt.Fprintf(w, "Controllable:\ttrue\n")
Expand Down

0 comments on commit 789038c

Please sign in to comment.