Skip to content

Commit

Permalink
Hotfix cache logic bug in Tessie (#107187)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 authored and frenck committed Jan 5, 2024
1 parent 4e126d6 commit c242dcd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions homeassistant/components/tessie/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def __init__(
self.vin = vin
self.session = async_get_clientsession(hass)
self.data = self._flatten(data)
self.did_first_update = False

async def _async_update_data(self) -> dict[str, Any]:
"""Update vehicle data using Tessie API."""
Expand All @@ -50,15 +49,14 @@ async def _async_update_data(self) -> dict[str, Any]:
session=self.session,
api_key=self.api_key,
vin=self.vin,
use_cache=self.did_first_update,
use_cache=False,
)
except ClientResponseError as e:
if e.status == HTTPStatus.UNAUTHORIZED:
# Auth Token is no longer valid
raise ConfigEntryAuthFailed from e
raise e

self.did_first_update = True
if vehicle["state"] == TessieStatus.ONLINE:
# Vehicle is online, all data is fresh
return self._flatten(vehicle)
Expand Down

0 comments on commit c242dcd

Please sign in to comment.