diff --git a/homeassistant/components/iotawatt/coordinator.py b/homeassistant/components/iotawatt/coordinator.py index 4f9ac1f94b7..13802ebdd76 100644 --- a/homeassistant/components/iotawatt/coordinator.py +++ b/homeassistant/components/iotawatt/coordinator.py @@ -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, )