Skip to content

Commit

Permalink
Changes from MyBMW 3.3.1 (#530)
Browse files Browse the repository at this point in the history
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
  • Loading branch information
rikroe and rikroe authored Apr 26, 2023
1 parent 17ca78b commit 09d2774
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions bimmer_connected/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ async def _init_vehicles(self) -> None:
VEHICLES_URL,
headers={
**client.generate_default_header(brand),
"bmw-current-date": fetched_at.isoformat(),
},
)
for brand in CarBrands
Expand All @@ -98,9 +97,12 @@ async def get_vehicles(self, force_init: bool = False) -> None:
# Get the detailed vehicle state
state_response = await client.get(
VEHICLE_STATE_URL,
params={
"apptimezone": self.utcdiff,
"appDateTime": int(fetched_at.timestamp() * 1000),
},
headers={
**client.generate_default_header(vehicle.brand),
"bmw-current-date": fetched_at.isoformat(),
"bmw-vin": vehicle.vin,
},
)
Expand Down
6 changes: 6 additions & 0 deletions bimmer_connected/api/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ async def _login_row_na(self):
# With authorization, call authenticate endpoint second time to get code
response = await client.post(
authenticate_url,
params={
"interaction-id": uuid4(),
"client-version": X_USER_AGENT.format(
brand="bmw", app_version=get_app_version(self.region), region=self.region.value
),
},
data=dict(oauth_base_values, **{"authorization": authorization}),
)
code = response.next_request.url.params["code"]
Expand Down
6 changes: 3 additions & 3 deletions bimmer_connected/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class Regions(str, Enum):
}

APP_VERSIONS = {
Regions.NORTH_AMERICA: "3.1.0(20658)",
Regions.REST_OF_WORLD: "3.1.0(20658)",
Regions.CHINA: "3.1.0(20658)",
Regions.NORTH_AMERICA: "3.3.1(22418)",
Regions.REST_OF_WORLD: "3.3.1(22418)",
Regions.CHINA: "3.3.1(22418)",
}

HTTPX_TIMEOUT = 30.0
Expand Down

0 comments on commit 09d2774

Please sign in to comment.