Skip to content

Commit 789038c

Browse files
committed
cli/charger: add status reason
1 parent 7626bab commit 789038c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/dumper.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ func (d *dumper) Dump(name string, v interface{}) {
116116
}
117117
}
118118

119+
if v, ok := v.(api.StatusReasoner); ok {
120+
if status, err := v.StatusReason(); err != nil {
121+
fmt.Fprintf(w, "Status reason:\t%v\n", err)
122+
} else {
123+
fmt.Fprintf(w, "Status reason:\t%v\n", status)
124+
}
125+
}
126+
119127
// controllable battery
120128
if _, ok := v.(api.BatteryController); ok {
121129
fmt.Fprintf(w, "Controllable:\ttrue\n")

0 commit comments

Comments
 (0)