Upgrade url-normalize to 2.2.1 (#143751)

This commit is contained in:
Ville Skyttä
2025-04-29 20:10:57 +03:00
committed by GitHub
parent efcf8f9555
commit ab695f90c7
7 changed files with 18 additions and 15 deletions

View File

@ -276,11 +276,12 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
if TYPE_CHECKING:
assert discovery_info.ssdp_location
url = url_normalize(
discovery_info.upnp.get(
ATTR_UPNP_PRESENTATION_URL,
f"http://{urlparse(discovery_info.ssdp_location).hostname}/",
)
discovery_info.upnp.get(ATTR_UPNP_PRESENTATION_URL)
or f"http://{urlparse(discovery_info.ssdp_location).hostname}/"
)
if TYPE_CHECKING:
# url_normalize only returns None if passed None, and we don't do that
assert url is not None
unique_id = discovery_info.upnp.get(
ATTR_UPNP_SERIAL, discovery_info.upnp[ATTR_UPNP_UDN]

View File

@ -9,7 +9,7 @@
"requirements": [
"huawei-lte-api==1.11.0",
"stringcase==1.2.0",
"url-normalize==2.2.0"
"url-normalize==2.2.1"
],
"ssdp": [
{

View File

@ -1,7 +1,7 @@
"""Config flow for Samsung SyncThru."""
import re
from typing import Any
from typing import TYPE_CHECKING, Any
from urllib.parse import urlparse
from pysyncthru import ConnectionMode, SyncThru, SyncThruAPINotSupported
@ -44,12 +44,14 @@ class SyncThruConfigFlow(ConfigFlow, domain=DOMAIN):
await self.async_set_unique_id(discovery_info.upnp[ATTR_UPNP_UDN])
self._abort_if_unique_id_configured()
self.url = url_normalize(
discovery_info.upnp.get(
ATTR_UPNP_PRESENTATION_URL,
f"http://{urlparse(discovery_info.ssdp_location or '').hostname}/",
)
norm_url = url_normalize(
discovery_info.upnp.get(ATTR_UPNP_PRESENTATION_URL)
or f"http://{urlparse(discovery_info.ssdp_location or '').hostname}/"
)
if TYPE_CHECKING:
# url_normalize only returns None if passed None, and we don't do that
assert norm_url is not None
self.url = norm_url
for existing_entry in (
x for x in self._async_current_entries() if x.data[CONF_URL] == self.url

View File

@ -6,7 +6,7 @@
"documentation": "https://www.home-assistant.io/integrations/syncthru",
"iot_class": "local_polling",
"loggers": ["pysyncthru"],
"requirements": ["PySyncThru==0.8.0", "url-normalize==2.2.0"],
"requirements": ["PySyncThru==0.8.0", "url-normalize==2.2.1"],
"ssdp": [
{
"deviceType": "urn:schemas-upnp-org:device:Printer:1",

View File

@ -6,7 +6,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zwave_me",
"iot_class": "local_push",
"requirements": ["zwave-me-ws==0.4.3", "url-normalize==2.2.0"],
"requirements": ["zwave-me-ws==0.4.3", "url-normalize==2.2.1"],
"zeroconf": [
{
"type": "_hap._tcp.local.",

2
requirements_all.txt generated
View File

@ -3001,7 +3001,7 @@ upcloud-api==2.6.0
# homeassistant.components.huawei_lte
# homeassistant.components.syncthru
# homeassistant.components.zwave_me
url-normalize==2.2.0
url-normalize==2.2.1
# homeassistant.components.uvc
uvcclient==0.12.1

View File

@ -2424,7 +2424,7 @@ upcloud-api==2.6.0
# homeassistant.components.huawei_lte
# homeassistant.components.syncthru
# homeassistant.components.zwave_me
url-normalize==2.2.0
url-normalize==2.2.1
# homeassistant.components.uvc
uvcclient==0.12.1