Skip to content

Commit cee3b44

Browse files
committed
Give the coordinator product data
1 parent 9d04aa6 commit cee3b44

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

custom_components/teslemetry/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
5555
if "vin" in product:
5656
vin = product["vin"]
5757
api = VehicleSpecific(teslemetry.vehicle, vin)
58-
coordinator = TeslemetryVehicleDataCoordinator(hass, api)
58+
coordinator = TeslemetryVehicleDataCoordinator(hass, api, product)
5959
vehicles.append(
6060
TeslemetryVehicleData(
6161
api=api,

custom_components/teslemetry/coordinator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TeslemetryVehicleDataCoordinator(DataUpdateCoordinator[dict[str, Any]]):
1919

2020

2121

22-
def __init__(self, hass: HomeAssistant, api: VehicleSpecific) -> None:
22+
def __init__(self, hass: HomeAssistant, api: VehicleSpecific, product: dict) -> None:
2323
"""Initialize Teslemetry Vehicle Update Coordinator."""
2424
super().__init__(
2525
hass,
@@ -28,7 +28,7 @@ def __init__(self, hass: HomeAssistant, api: VehicleSpecific) -> None:
2828
update_interval=timedelta(seconds=SYNC_INTERVAL),
2929
)
3030
self.api = api
31-
self.data = {"state": None}
31+
self.data = product
3232

3333
async def _async_update_data(self) -> dict[str, Any]:
3434
"""Update vehicle data using Teslemetry API."""

0 commit comments

Comments
 (0)