Smart Hello: add charge state (#15939)
This commit is contained in:
parent
cbafc3e0c3
commit
62e252d2df
1 changed files with 15 additions and 0 deletions
|
|
@ -30,6 +30,21 @@ func (v *Provider) Soc() (float64, error) {
|
|||
return float64(res.AdditionalVehicleStatus.ElectricVehicleStatus.ChargeLevel), err
|
||||
}
|
||||
|
||||
var _ api.ChargeState = (*Provider)(nil)
|
||||
|
||||
// Status implements the api.ChargeState interface
|
||||
func (v *Provider) Status() (api.ChargeStatus, error) {
|
||||
res, err := v.statusG()
|
||||
switch res.AdditionalVehicleStatus.ElectricVehicleStatus.ChargerState {
|
||||
case 1, 3:
|
||||
return api.StatusB, err
|
||||
case 2:
|
||||
return api.StatusC, err
|
||||
default:
|
||||
return api.StatusA, err
|
||||
}
|
||||
}
|
||||
|
||||
var _ api.VehicleRange = (*Provider)(nil)
|
||||
|
||||
// Range implements the api.VehicleRange interface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue