From ab695f90c74fb115f4af90c0f01d5e2dc598d651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 29 Apr 2025 20:10:57 +0300 Subject: [PATCH] Upgrade url-normalize to 2.2.1 (#143751) --- homeassistant/components/huawei_lte/config_flow.py | 9 +++++---- homeassistant/components/huawei_lte/manifest.json | 2 +- homeassistant/components/syncthru/config_flow.py | 14 ++++++++------ homeassistant/components/syncthru/manifest.json | 2 +- homeassistant/components/zwave_me/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/homeassistant/components/huawei_lte/config_flow.py b/homeassistant/components/huawei_lte/config_flow.py index 4ca9e7531e3..bcbeec09bf7 100644 --- a/homeassistant/components/huawei_lte/config_flow.py +++ b/homeassistant/components/huawei_lte/config_flow.py @@ -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] diff --git a/homeassistant/components/huawei_lte/manifest.json b/homeassistant/components/huawei_lte/manifest.json index e58525e3af4..c2e945e9c49 100644 --- a/homeassistant/components/huawei_lte/manifest.json +++ b/homeassistant/components/huawei_lte/manifest.json @@ -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": [ { diff --git a/homeassistant/components/syncthru/config_flow.py b/homeassistant/components/syncthru/config_flow.py index 1407814f838..c245b181cc2 100644 --- a/homeassistant/components/syncthru/config_flow.py +++ b/homeassistant/components/syncthru/config_flow.py @@ -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 diff --git a/homeassistant/components/syncthru/manifest.json b/homeassistant/components/syncthru/manifest.json index 11c688eb9af..a33cefd2c70 100644 --- a/homeassistant/components/syncthru/manifest.json +++ b/homeassistant/components/syncthru/manifest.json @@ -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", diff --git a/homeassistant/components/zwave_me/manifest.json b/homeassistant/components/zwave_me/manifest.json index 43a39de29c5..e687f992afc 100644 --- a/homeassistant/components/zwave_me/manifest.json +++ b/homeassistant/components/zwave_me/manifest.json @@ -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.", diff --git a/requirements_all.txt b/requirements_all.txt index edabf5f4c49..48459fc026a 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -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 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 31e66e38b15..a7e2b5da93c 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -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