Skip to content

Commit

Permalink
Explicitly pass in the config_entry in landisgyr_heat_meter coordinat…
Browse files Browse the repository at this point in the history
…or (#138119)

explicitly pass in the config_entry in coordinator
  • Loading branch information
mib1185 authored Feb 9, 2025
1 parent b9fd5d0 commit 9e7f8b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/landisgyr_heat_meter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
reader = ultraheat_api.UltraheatReader(entry.data[CONF_DEVICE])
api = ultraheat_api.HeatMeterService(reader)

coordinator = UltraheatCoordinator(hass, api)
coordinator = UltraheatCoordinator(hass, entry, api)
await coordinator.async_config_entry_first_refresh()

hass.data.setdefault(DOMAIN, {})[entry.entry_id] = coordinator
Expand Down
8 changes: 7 additions & 1 deletion homeassistant/components/landisgyr_heat_meter/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ultraheat_api.response import HeatMeterResponse
from ultraheat_api.service import HeatMeterService

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed

Expand All @@ -18,11 +19,16 @@
class UltraheatCoordinator(DataUpdateCoordinator[HeatMeterResponse]):
"""Coordinator for getting data from the ultraheat api."""

def __init__(self, hass: HomeAssistant, api: HeatMeterService) -> None:
config_entry: ConfigEntry

def __init__(
self, hass: HomeAssistant, config_entry: ConfigEntry, api: HeatMeterService
) -> None:
"""Initialize my coordinator."""
super().__init__(
hass,
_LOGGER,
config_entry=config_entry,
name="ultraheat",
update_interval=POLLING_INTERVAL,
)
Expand Down

0 comments on commit 9e7f8b7

Please sign in to comment.