Skip to content

Commit

Permalink
Enyaq: add settings api (#3773)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElinaUrbanovich authored Jul 7, 2022
1 parent a0d75bb commit 490e0ed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vehicle/skoda/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions vehicle/skoda/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

0 comments on commit 490e0ed

Please sign in to comment.