From 2d1d1593b6dbc35afb1270dbdb899467e0d02d45 Mon Sep 17 00:00:00 2001 From: Elina Urbanovich <83229929+ElinaUrbanovich@users.noreply.github.com> Date: Wed, 24 Aug 2022 17:43:09 +0300 Subject: [PATCH] Ford: add chargeEndTime to status response (#4219) --- vehicle/ford/provider.go | 8 ++++++++ vehicle/ford/types.go | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/vehicle/ford/provider.go b/vehicle/ford/provider.go index 0e4401ff36..4369faed3a 100644 --- a/vehicle/ford/provider.go +++ b/vehicle/ford/provider.go @@ -132,6 +132,14 @@ func (v *Provider) Position() (float64, float64, error) { return res.VehicleStatus.Gps.Latitude, res.VehicleStatus.Gps.Longitude, err } +var _ api.VehicleFinishTimer = (*Provider)(nil) + +// FinishTime implements the api.VehicleFinishTimer interface +func (v *Provider) FinishTime() (time.Time, error) { + res, err := v.statusG() + return res.VehicleStatus.ChargeEndTime.Value.Time, err +} + var _ api.Resurrector = (*Provider)(nil) // WakeUp implements the api.Resurrector interface diff --git a/vehicle/ford/types.go b/vehicle/ford/types.go index b406ea0dba..8b8327c956 100644 --- a/vehicle/ford/types.go +++ b/vehicle/ford/types.go @@ -28,6 +28,10 @@ type StatusResponse struct { Value string Timestamp Timestamp } + ChargeEndTime struct { + Value Timestamp + Timestamp Timestamp + } PlugStatus struct { Value int Timestamp Timestamp