diff --git a/api/api.go b/api/api.go index 6707ed9fa..985328762 100644 --- a/api/api.go +++ b/api/api.go @@ -164,6 +164,11 @@ type VehicleOdometer interface { Odometer() (float64, error) } +// VehiclePosition returns the vehicles position in latitude and longitude +type VehiclePosition interface { + Position() (float64, float64, error) +} + // VehicleStartCharge starts the charging session on the vehicle side type VehicleStartCharge interface { StartCharge() error diff --git a/cmd/dumper.go b/cmd/dumper.go index 69247bb8b..1a38eba91 100644 --- a/cmd/dumper.go +++ b/cmd/dumper.go @@ -162,6 +162,14 @@ func (d *dumper) Dump(name string, v interface{}) { } } + if v, ok := v.(api.VehiclePosition); ok { + if lat, lon, err := v.Position(); err != nil { + fmt.Fprintf(w, "Position:\t%v\n", err) + } else { + fmt.Fprintf(w, "Position:\t%v,%v\n", lat, lon) + } + } + if v, ok := v.(api.Vehicle); ok { fmt.Fprintf(w, "Capacity:\t%dkWh\n", v.Capacity()) if len(v.Identifiers()) > 0 {