Enyaq: add settings api (#3773)
This commit is contained in:
parent
a0d75bb828
commit
490e0edd4b
2 changed files with 15 additions and 0 deletions
|
|
@ -55,6 +55,14 @@ func (v *API) Charger(vin string) (ChargerResponse, error) {
|
|||
return res, err
|
||||
}
|
||||
|
||||
// Settings implements the /v1/charging/<vin>/settings response
|
||||
func (v *API) Settings(vin string) (SettingsResponse, error) {
|
||||
var res SettingsResponse
|
||||
uri := fmt.Sprintf("%s/v1/charging/%s/settings", BaseURI, vin)
|
||||
err := v.GetJSON(uri, &res)
|
||||
return res, err
|
||||
}
|
||||
|
||||
const (
|
||||
ActionCharge = "charging"
|
||||
ActionChargeStart = "Start"
|
||||
|
|
|
|||
|
|
@ -35,3 +35,10 @@ type ChargerResponse struct {
|
|||
StateOfChargeInPercent int
|
||||
}
|
||||
}
|
||||
|
||||
// SettingsResponse is the /v1/charging/<vin>/settings api
|
||||
type SettingsResponse struct {
|
||||
AutoUnlockPlugWhenCharged string `json:"autoUnlockPlugWhenCharged"`
|
||||
MaxChargeCurrentAc string `json:"maxChargeCurrentAc"`
|
||||
TargetStateOfChargeInPercent int `json:"targetStateOfChargeInPercent"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue