mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Improve iterable typing (2) (#79296)
* Improve iterable typing (2) * Use collection
This commit is contained in:
parent
3a9ecab98a
commit
249922ba1b
@ -489,7 +489,7 @@ class HomeKit:
|
|||||||
advertise_ip: str | None,
|
advertise_ip: str | None,
|
||||||
entry_id: str,
|
entry_id: str,
|
||||||
entry_title: str,
|
entry_title: str,
|
||||||
devices: Iterable[str] | None = None,
|
devices: list[str] | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize a HomeKit object."""
|
"""Initialize a HomeKit object."""
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Iterable
|
from collections.abc import Collection, Iterable
|
||||||
|
|
||||||
from aiolifx.aiolifx import LifxDiscovery, Light, ScanManager
|
from aiolifx.aiolifx import LifxDiscovery, Light, ScanManager
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ from .const import CONF_SERIAL, DOMAIN
|
|||||||
DEFAULT_TIMEOUT = 8.5
|
DEFAULT_TIMEOUT = 8.5
|
||||||
|
|
||||||
|
|
||||||
async def async_discover_devices(hass: HomeAssistant) -> Iterable[Light]:
|
async def async_discover_devices(hass: HomeAssistant) -> Collection[Light]:
|
||||||
"""Discover lifx devices."""
|
"""Discover lifx devices."""
|
||||||
all_lights: dict[str, Light] = {}
|
all_lights: dict[str, Light] = {}
|
||||||
broadcast_addrs = await network.async_get_ipv4_broadcast_addresses(hass)
|
broadcast_addrs = await network.async_get_ipv4_broadcast_addresses(hass)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user