diff --git a/custom_components/fordpass/__init__.py b/custom_components/fordpass/__init__.py index 1603da3..6bed789 100644 --- a/custom_components/fordpass/__init__.py +++ b/custom_components/fordpass/__init__.py @@ -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): diff --git a/custom_components/fordpass/fordpass_new.py b/custom_components/fordpass/fordpass_new.py index 02aa803..2c1dfc2 100644 --- a/custom_components/fordpass/fordpass_new.py +++ b/custom_components/fordpass/fordpass_new.py @@ -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, ) diff --git a/custom_components/fordpass/switch.py b/custom_components/fordpass/switch.py index aa5e762..78e6a21 100644 --- a/custom_components/fordpass/switch.py +++ b/custom_components/fordpass/switch.py @@ -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": @@ -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):