From b6a75cb6474e37529c424aef8cea08e9ba241c6d Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Thu, 21 Sep 2023 18:09:59 -0600 Subject: [PATCH] Fix error loading multiple vehicles --- custom_components/rivian/coordinator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/rivian/coordinator.py b/custom_components/rivian/coordinator.py index 73c855d..54d3d4d 100644 --- a/custom_components/rivian/coordinator.py +++ b/custom_components/rivian/coordinator.py @@ -208,9 +208,6 @@ class VehicleCoordinator(RivianDataUpdateCoordinator[dict[str, Any]]): key = "vehicleState" _update_interval = 15 * 60 # 15 minutes - _initial = asyncio.Event() - _unsub_handler: Coroutine[None, None, None] | None = None - _awake = asyncio.Event() def __init__(self, hass: HomeAssistant, client: Rivian, vehicle_id: str) -> None: """Initialize the coordinator.""" @@ -218,6 +215,9 @@ def __init__(self, hass: HomeAssistant, client: Rivian, vehicle_id: str) -> None self.vehicle_id = vehicle_id self.charging_coordinator = ChargingCoordinator(hass, client, vehicle_id) self.drivers_coordinator = DriverKeyCoordinator(hass, client, vehicle_id) + self._initial = asyncio.Event() + self._unsub_handler: Coroutine[None, None, None] | None = None + self._awake = asyncio.Event() async def _async_update_data(self) -> dict[str, Any]: """Get the latest data from Rivian."""