Skip to content

Commit

Permalink
cli/charger: dump configured currents and phases (if available)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jun 30, 2024
1 parent e923886 commit 391fadd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cmd/dumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,24 @@ func (d *dumper) Dump(name string, v interface{}) {
}
}

// currents and phases

if v, ok := v.(api.CurrentGetter); ok {
if f, err := v.GetMaxCurrent(); err != nil {
fmt.Fprintf(w, "Max Current:\t%v\n", err)
} else {
fmt.Fprintf(w, "Max Current:\t%.1fA\n", f)
}
}

if v, ok := v.(api.PhaseGetter); ok {
if f, err := v.GetPhases(); err != nil {
fmt.Fprintf(w, "Phases:\t%v\n", err)
} else {
fmt.Fprintf(w, "Phases:\t%d\n", f)
}
}

// Identity

if v, ok := v.(api.Identifier); ok {
Expand Down

0 comments on commit 391fadd

Please sign in to comment.