mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Hotfix cache logic bug in Tessie (#107187)
This commit is contained in:
parent
298e2e2b99
commit
ace4edf91c
@ -41,7 +41,6 @@ class TessieStateUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||||||
self.vin = vin
|
self.vin = vin
|
||||||
self.session = async_get_clientsession(hass)
|
self.session = async_get_clientsession(hass)
|
||||||
self.data = self._flatten(data)
|
self.data = self._flatten(data)
|
||||||
self.did_first_update = False
|
|
||||||
|
|
||||||
async def _async_update_data(self) -> dict[str, Any]:
|
async def _async_update_data(self) -> dict[str, Any]:
|
||||||
"""Update vehicle data using Tessie API."""
|
"""Update vehicle data using Tessie API."""
|
||||||
@ -50,7 +49,7 @@ class TessieStateUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||||||
session=self.session,
|
session=self.session,
|
||||||
api_key=self.api_key,
|
api_key=self.api_key,
|
||||||
vin=self.vin,
|
vin=self.vin,
|
||||||
use_cache=self.did_first_update,
|
use_cache=False,
|
||||||
)
|
)
|
||||||
except ClientResponseError as e:
|
except ClientResponseError as e:
|
||||||
if e.status == HTTPStatus.UNAUTHORIZED:
|
if e.status == HTTPStatus.UNAUTHORIZED:
|
||||||
@ -58,7 +57,6 @@ class TessieStateUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||||||
raise ConfigEntryAuthFailed from e
|
raise ConfigEntryAuthFailed from e
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
self.did_first_update = True
|
|
||||||
if vehicle["state"] == TessieStatus.ONLINE:
|
if vehicle["state"] == TessieStatus.ONLINE:
|
||||||
# Vehicle is online, all data is fresh
|
# Vehicle is online, all data is fresh
|
||||||
return self._flatten(vehicle)
|
return self._flatten(vehicle)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user