Remove unnecessary hass assignment in coordinators (#150696)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Joost Lekkerkerker
2025-08-15 15:52:13 +02:00
committed by GitHub
parent 793a829236
commit d5a74892e6
11 changed files with 2 additions and 14 deletions

View File

@@ -30,10 +30,9 @@ class AndroidIPCamDataUpdateCoordinator(DataUpdateCoordinator[None]):
cam: PyDroidIPCam,
) -> None:
"""Initialize the Android IP Webcam."""
self.hass = hass
self.cam = cam
super().__init__(
self.hass,
hass,
_LOGGER,
config_entry=config_entry,
name=f"{DOMAIN} {config_entry.data[CONF_HOST]}",

View File

@@ -120,7 +120,6 @@ class FritzBoxTools(DataUpdateCoordinator[UpdateCoordinatorDataType]):
self.fritz_guest_wifi: FritzGuestWLAN = None
self.fritz_hosts: FritzHosts = None
self.fritz_status: FritzStatus = None
self.hass = hass
self.host = host
self.mesh_role = MeshRoles.NONE
self.mesh_wifi_uplink = False

View File

@@ -29,7 +29,6 @@ class GlancesDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
self, hass: HomeAssistant, entry: GlancesConfigEntry, api: Glances
) -> None:
"""Initialize the Glances data."""
self.hass = hass
self.host: str = entry.data[CONF_HOST]
self.api = api
super().__init__(

View File

@@ -40,7 +40,6 @@ class FirmwareUpdateCoordinator(DataUpdateCoordinator[FirmwareManifest]):
update_interval=FIRMWARE_REFRESH_INTERVAL,
config_entry=config_entry,
)
self.hass = hass
self.session = session
self.client = FirmwareUpdateClient(url, session)

View File

@@ -42,7 +42,6 @@ class LaCrosseUpdateCoordinator(DataUpdateCoordinator[list[Sensor]]):
self.last_update = time()
self.username = entry.data["username"]
self.password = entry.data["password"]
self.hass = hass
self.name = entry.data["name"]
self.id = entry.data["id"]
super().__init__(

View File

@@ -45,7 +45,6 @@ class LivisiDataUpdateCoordinator(DataUpdateCoordinator[list[dict[str, Any]]]):
name="Livisi devices",
update_interval=timedelta(seconds=DEVICE_POLLING_DELAY),
)
self.hass = hass
self.aiolivisi = aiolivisi
self.websocket = Websocket(aiolivisi)
self.devices: set[str] = set()

View File

@@ -31,7 +31,6 @@ class PlaatoCoordinator(DataUpdateCoordinator):
) -> None:
"""Initialize."""
self.api = Plaato(auth_token=auth_token)
self.hass = hass
self.device_type = device_type
self.platforms: list[Platform] = []

View File

@@ -44,7 +44,6 @@ class RachioUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
base_count: int,
) -> None:
"""Initialize the Rachio Update Coordinator."""
self.hass = hass
self.rachio = rachio
self.base_station = base_station
super().__init__(
@@ -83,7 +82,6 @@ class RachioScheduleUpdateCoordinator(DataUpdateCoordinator[list[dict[str, Any]]
base_station,
) -> None:
"""Initialize a Rachio schedule coordinator."""
self.hass = hass
self.rachio = rachio
self.base_station = base_station
super().__init__(

View File

@@ -25,7 +25,6 @@ class RomyVacuumCoordinator(DataUpdateCoordinator[None]):
name=DOMAIN,
update_interval=UPDATE_INTERVAL,
)
self.hass = hass
self.romy = romy
async def _async_update_data(self) -> None:

View File

@@ -29,11 +29,10 @@ class SpeedTestDataCoordinator(DataUpdateCoordinator[dict[str, Any]]):
api: speedtest.Speedtest,
) -> None:
"""Initialize the data object."""
self.hass = hass
self.api = api
self.servers: dict[str, dict] = {DEFAULT_SERVER: {}}
super().__init__(
self.hass,
hass,
_LOGGER,
config_entry=config_entry,
name=DOMAIN,

View File

@@ -102,7 +102,6 @@ class DeviceCoordinator(DataUpdateCoordinator[None]):
name=wemo.name,
update_interval=timedelta(seconds=30),
)
self.hass = hass
self.wemo = wemo
self.device_id: str | None = None
self.device_info = _create_device_info(wemo)