BMW/Mini: fix retrieving vehicles (#3917)
This commit is contained in:
parent
5662d0e55b
commit
4294fe3f0d
2 changed files with 10 additions and 10 deletions
|
|
@ -29,7 +29,7 @@ type API struct {
|
|||
func NewAPI(log *util.Logger, brand string, identity oauth2.TokenSource) *API {
|
||||
v := &API{
|
||||
Helper: request.NewHelper(log),
|
||||
xUserAgent: fmt.Sprintf("android(SP1A.210812.016.C1);%s;2.5.2(14945);row", brand),
|
||||
xUserAgent: fmt.Sprintf("android(SP1A.210812.016.C1);%s;99.0.0(99999);row", brand),
|
||||
}
|
||||
|
||||
// replace client transport with authenticated transport
|
||||
|
|
@ -43,12 +43,11 @@ func NewAPI(log *util.Logger, brand string, identity oauth2.TokenSource) *API {
|
|||
|
||||
func (v *API) eadrax() (VehiclesStatusResponse, error) {
|
||||
var res VehiclesStatusResponse
|
||||
uri := fmt.Sprintf("%s/eadrax-vcs/v1/vehicles?apptimezone=120&appDateTime=%d", CocoApiURI, time.Now().Unix())
|
||||
uri := fmt.Sprintf("%s/eadrax-vcs/v1/vehicles?apptimezone=120&appDateTime=%d", CocoApiURI, time.Now().UnixMilli())
|
||||
|
||||
req, err := request.New(http.MethodGet, uri, nil, map[string]string{
|
||||
"Content-Type": request.JSONContent,
|
||||
"X-User-Agent": v.xUserAgent,
|
||||
"bmw-units-preferences": "d=KM;v=L",
|
||||
})
|
||||
if err == nil {
|
||||
err = v.DoJSON(req, &res)
|
||||
|
|
|
|||
|
|
@ -112,7 +112,8 @@ func (v *Identity) login() (*oauth2.Token, error) {
|
|||
"response_type": {"code"},
|
||||
"redirect_uri": {RedirectURI},
|
||||
"state": {"cwU-gIE27j67poy2UcL3KQ"},
|
||||
"scope": {"authenticate_user vehicle_data remote_services"},
|
||||
// "scope": {"authenticate_user vehicle_data remote_services"},
|
||||
"scope": {"openid profile email offline_access smacc vehicle_data perseus dlm svds cesim vsapi remote_services fupo authenticate_user"},
|
||||
"nonce": {"login_nonce"},
|
||||
"code_challenge_method": {"S256"},
|
||||
"code_challenge": {cv.CodeChallengeS256()},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue