mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Ensure braviatv config flow title_placeholders items are [str, str] (#127287)
This commit is contained in:
parent
689372b572
commit
81d7d2a70a
@ -3,7 +3,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any, cast
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from aiohttp import CookieJar
|
from aiohttp import CookieJar
|
||||||
@ -207,8 +207,9 @@ class BraviaTVConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self, discovery_info: ssdp.SsdpServiceInfo
|
self, discovery_info: ssdp.SsdpServiceInfo
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a discovered device."""
|
"""Handle a discovered device."""
|
||||||
parsed_url = urlparse(discovery_info.ssdp_location)
|
# We can cast the hostname to str because the ssdp_location is not bytes and
|
||||||
host = parsed_url.hostname
|
# not a relative url
|
||||||
|
host = cast(str, urlparse(discovery_info.ssdp_location).hostname)
|
||||||
|
|
||||||
await self.async_set_unique_id(discovery_info.upnp[ssdp.ATTR_UPNP_UDN])
|
await self.async_set_unique_id(discovery_info.upnp[ssdp.ATTR_UPNP_UDN])
|
||||||
self._abort_if_unique_id_configured(updates={CONF_HOST: host})
|
self._abort_if_unique_id_configured(updates={CONF_HOST: host})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user