Use new ServiceInfo location in sonos (#135699)

This commit is contained in:
epenet 2025-01-15 16:14:21 +01:00 committed by GitHub
parent 406c00997f
commit 7a442af9fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,10 +3,11 @@
from collections.abc import Awaitable from collections.abc import Awaitable
import dataclasses import dataclasses
from homeassistant.components import ssdp, zeroconf from homeassistant.components import ssdp
from homeassistant.config_entries import ConfigFlowResult from homeassistant.config_entries import ConfigFlowResult
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.config_entry_flow import DiscoveryFlowHandler from homeassistant.helpers.config_entry_flow import DiscoveryFlowHandler
from homeassistant.helpers.service_info.zeroconf import ZeroconfServiceInfo
from .const import DATA_SONOS_DISCOVERY_MANAGER, DOMAIN, UPNP_ST from .const import DATA_SONOS_DISCOVERY_MANAGER, DOMAIN, UPNP_ST
from .helpers import hostname_to_uid from .helpers import hostname_to_uid
@ -25,7 +26,7 @@ class SonosDiscoveryFlowHandler(DiscoveryFlowHandler[Awaitable[bool]], domain=DO
super().__init__(DOMAIN, "Sonos", _async_has_devices) super().__init__(DOMAIN, "Sonos", _async_has_devices)
async def async_step_zeroconf( async def async_step_zeroconf(
self, discovery_info: zeroconf.ZeroconfServiceInfo self, discovery_info: ZeroconfServiceInfo
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Handle a flow initialized by zeroconf.""" """Handle a flow initialized by zeroconf."""
hostname = discovery_info.hostname hostname = discovery_info.hostname