Fix "tunneling" spelling in KNX (#144895)

This commit is contained in:
Matthias Alphart 2025-05-14 17:05:45 +02:00 committed by GitHub
parent a0f35a84ae
commit 2d0c1fac24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 18 deletions

View File

@ -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:

View File

@ -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

View File

@ -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": {

View File

@ -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(