mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Explicitly pass in the config_entry in iotawatt coordinator (#138141)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
e7d49823e4
commit
0decb0cfba
@ -26,13 +26,14 @@ class IotawattUpdater(DataUpdateCoordinator):
|
||||
"""Class to manage fetching update data from the IoTaWatt Energy Device."""
|
||||
|
||||
api: Iotawatt | None = None
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||
"""Initialize IotaWattUpdater object."""
|
||||
self.entry = entry
|
||||
super().__init__(
|
||||
hass=hass,
|
||||
logger=_LOGGER,
|
||||
config_entry=entry,
|
||||
name=entry.title,
|
||||
update_interval=timedelta(seconds=30),
|
||||
request_refresh_debouncer=Debouncer(
|
||||
@ -57,11 +58,11 @@ class IotawattUpdater(DataUpdateCoordinator):
|
||||
"""Fetch sensors from IoTaWatt device."""
|
||||
if self.api is None:
|
||||
api = Iotawatt(
|
||||
self.entry.title,
|
||||
self.entry.data[CONF_HOST],
|
||||
self.config_entry.title,
|
||||
self.config_entry.data[CONF_HOST],
|
||||
httpx_client.get_async_client(self.hass),
|
||||
self.entry.data.get(CONF_USERNAME),
|
||||
self.entry.data.get(CONF_PASSWORD),
|
||||
self.config_entry.data.get(CONF_USERNAME),
|
||||
self.config_entry.data.get(CONF_PASSWORD),
|
||||
integratedInterval="d",
|
||||
includeNonTotalSensors=False,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user