Skip to content

Commit

Permalink
Fix token refresh error
Browse files Browse the repository at this point in the history
  • Loading branch information
itchannel committed Jul 27, 2023
1 parent e675acb commit d9783b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions custom_components/fordpass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def refresh_status(hass, service, coordinator):
_LOGGER.debug("Invalid VIN")
elif status == 200:
_LOGGER.debug("Refresh Sent")



def clear_tokens(hass, service, coordinator):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/fordpass/fordpass_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def refreshToken(self, token):
headers = {**apiHeaders, "Application-Id": self.region}

r = session.post(
f"https://{guardUrl}/token/v2/cat-with-refresh-token",
f"{guardUrl}/token/v2/cat-with-refresh-token",
data=json.dumps(data),
headers=headers,
)
Expand Down
2 changes: 2 additions & 0 deletions custom_components/fordpass/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async def async_turn_on(self, **kwargs):
self.coordinator.vehicle.enableGuard
)
await self.coordinator.async_request_refresh()
self.async_write_ha_state()

async def async_turn_off(self, **kwargs):
if self.switch == "ignition":
Expand All @@ -61,6 +62,7 @@ async def async_turn_off(self, **kwargs):
self.coordinator.vehicle.disableGuard
)
await self.coordinator.async_request_refresh()
self.async_write_ha_state()

@property
def name(self):
Expand Down

0 comments on commit d9783b7

Please sign in to comment.