From 2d0c1fac24ff46f1cebf0460330f2a06f85675f6 Mon Sep 17 00:00:00 2001 From: Matthias Alphart Date: Wed, 14 May 2025 17:05:45 +0200 Subject: [PATCH] Fix "tunneling" spelling in KNX (#144895) --- homeassistant/components/knx/config_flow.py | 20 ++++++++++---------- homeassistant/components/knx/const.py | 6 +++--- homeassistant/components/knx/strings.json | 4 ++-- tests/components/knx/test_config_flow.py | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/homeassistant/components/knx/config_flow.py b/homeassistant/components/knx/config_flow.py index eda160cd1a6..14a9016bcb9 100644 --- a/homeassistant/components/knx/config_flow.py +++ b/homeassistant/components/knx/config_flow.py @@ -84,9 +84,9 @@ CONF_KEYRING_FILE: Final = "knxkeys_file" CONF_KNX_TUNNELING_TYPE: Final = "tunneling_type" CONF_KNX_TUNNELING_TYPE_LABELS: Final = { - CONF_KNX_TUNNELING: "UDP (Tunnelling v1)", - CONF_KNX_TUNNELING_TCP: "TCP (Tunnelling v2)", - CONF_KNX_TUNNELING_TCP_SECURE: "Secure Tunnelling (TCP)", + CONF_KNX_TUNNELING: "UDP (Tunneling v1)", + CONF_KNX_TUNNELING_TCP: "TCP (Tunneling v2)", + CONF_KNX_TUNNELING_TCP_SECURE: "Secure Tunneling (TCP)", } OPTION_MANUAL_TUNNEL: Final = "Manual" @@ -393,7 +393,7 @@ class KNXCommonFlow(ABC, ConfigEntryBaseFlow): except (vol.Invalid, XKNXException): errors[CONF_KNX_LOCAL_IP] = "invalid_ip_address" - selected_tunnelling_type = user_input[CONF_KNX_TUNNELING_TYPE] + selected_tunneling_type = user_input[CONF_KNX_TUNNELING_TYPE] if not errors: try: self._selected_tunnel = await request_description( @@ -406,16 +406,16 @@ class KNXCommonFlow(ABC, ConfigEntryBaseFlow): errors["base"] = "cannot_connect" else: if bool(self._selected_tunnel.tunnelling_requires_secure) is not ( - selected_tunnelling_type == CONF_KNX_TUNNELING_TCP_SECURE + selected_tunneling_type == CONF_KNX_TUNNELING_TCP_SECURE ) or ( - selected_tunnelling_type == CONF_KNX_TUNNELING_TCP + selected_tunneling_type == CONF_KNX_TUNNELING_TCP and not self._selected_tunnel.supports_tunnelling_tcp ): errors[CONF_KNX_TUNNELING_TYPE] = "unsupported_tunnel_type" if not errors: self.new_entry_data = KNXConfigEntryData( - connection_type=selected_tunnelling_type, + connection_type=selected_tunneling_type, host=_host, port=user_input[CONF_PORT], route_back=user_input[CONF_KNX_ROUTE_BACK], @@ -426,11 +426,11 @@ class KNXCommonFlow(ABC, ConfigEntryBaseFlow): tunnel_endpoint_ia=None, ) - if selected_tunnelling_type == CONF_KNX_TUNNELING_TCP_SECURE: + if selected_tunneling_type == CONF_KNX_TUNNELING_TCP_SECURE: return await self.async_step_secure_key_source_menu_tunnel() self.new_title = ( "Tunneling " - f"{'UDP' if selected_tunnelling_type == CONF_KNX_TUNNELING else 'TCP'} " + f"{'UDP' if selected_tunneling_type == CONF_KNX_TUNNELING else 'TCP'} " f"@ {_host}" ) return self.finish_flow() @@ -497,7 +497,7 @@ class KNXCommonFlow(ABC, ConfigEntryBaseFlow): async def async_step_secure_tunnel_manual( self, user_input: dict | None = None ) -> ConfigFlowResult: - """Configure ip secure tunnelling manually.""" + """Configure ip secure tunneling manually.""" errors: dict = {} if user_input is not None: diff --git a/homeassistant/components/knx/const.py b/homeassistant/components/knx/const.py index c0c3b9ec2e6..3ce79b4ca7a 100644 --- a/homeassistant/components/knx/const.py +++ b/homeassistant/components/knx/const.py @@ -104,9 +104,9 @@ class KNXConfigEntryData(TypedDict, total=False): multicast_group: str multicast_port: int route_back: bool # not required - host: str # only required for tunnelling - port: int # only required for tunnelling - tunnel_endpoint_ia: str | None # tunnelling only - not required (use get()) + host: str # only required for tunneling + port: int # only required for tunneling + tunnel_endpoint_ia: str | None # tunneling only - not required (use get()) # KNX secure user_id: int | None # not required user_password: str | None # not required diff --git a/homeassistant/components/knx/strings.json b/homeassistant/components/knx/strings.json index 737cc2d8b2d..77228ea34d9 100644 --- a/homeassistant/components/knx/strings.json +++ b/homeassistant/components/knx/strings.json @@ -85,7 +85,7 @@ } }, "secure_tunnel_manual": { - "title": "Secure tunnelling", + "title": "Secure tunneling", "description": "Please enter your IP Secure information.", "data": { "user_id": "User ID", @@ -140,7 +140,7 @@ "keyfile_not_found": "The specified `.knxkeys` file was not found in the path config/.storage/knx/", "no_router_discovered": "No KNXnet/IP router was discovered on the network.", "no_tunnel_discovered": "Could not find a KNX tunneling server on your network.", - "unsupported_tunnel_type": "Selected tunnelling type not supported by gateway." + "unsupported_tunnel_type": "Selected tunneling type not supported by gateway." } }, "options": { diff --git a/tests/components/knx/test_config_flow.py b/tests/components/knx/test_config_flow.py index 3e4c9408542..6ebe8192f69 100644 --- a/tests/components/knx/test_config_flow.py +++ b/tests/components/knx/test_config_flow.py @@ -1033,7 +1033,7 @@ async def test_form_with_automatic_connection_handling( async def _get_menu_step_secure_tunnel(hass: HomeAssistant) -> FlowResult: - """Return flow in secure_tunnelling menu step.""" + """Return flow in secure_tunnel menu step.""" gateway = _gateway_descriptor( "192.168.0.1", 3675, @@ -1082,7 +1082,7 @@ async def test_get_secure_menu_step_manual_tunnelling( request_description_mock: MagicMock, hass: HomeAssistant, ) -> None: - """Test flow reaches secure_tunnellinn menu step from manual tunnelling configuration.""" + """Test flow reaches secure_tunnellinn menu step from manual tunneling configuration.""" gateway = _gateway_descriptor( "192.168.0.1", 3675, @@ -1129,7 +1129,7 @@ async def test_get_secure_menu_step_manual_tunnelling( async def test_configure_secure_tunnel_manual(hass: HomeAssistant, knx_setup) -> None: - """Test configure tunnelling secure keys manually.""" + """Test configure tunneling secure keys manually.""" menu_step = await _get_menu_step_secure_tunnel(hass) result = await hass.config_entries.flow.async_configure(