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: Final = "tunneling_type"
CONF_KNX_TUNNELING_TYPE_LABELS: Final = { CONF_KNX_TUNNELING_TYPE_LABELS: Final = {
CONF_KNX_TUNNELING: "UDP (Tunnelling v1)", CONF_KNX_TUNNELING: "UDP (Tunneling v1)",
CONF_KNX_TUNNELING_TCP: "TCP (Tunnelling v2)", CONF_KNX_TUNNELING_TCP: "TCP (Tunneling v2)",
CONF_KNX_TUNNELING_TCP_SECURE: "Secure Tunnelling (TCP)", CONF_KNX_TUNNELING_TCP_SECURE: "Secure Tunneling (TCP)",
} }
OPTION_MANUAL_TUNNEL: Final = "Manual" OPTION_MANUAL_TUNNEL: Final = "Manual"
@ -393,7 +393,7 @@ class KNXCommonFlow(ABC, ConfigEntryBaseFlow):
except (vol.Invalid, XKNXException): except (vol.Invalid, XKNXException):
errors[CONF_KNX_LOCAL_IP] = "invalid_ip_address" 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: if not errors:
try: try:
self._selected_tunnel = await request_description( self._selected_tunnel = await request_description(
@ -406,16 +406,16 @@ class KNXCommonFlow(ABC, ConfigEntryBaseFlow):
errors["base"] = "cannot_connect" errors["base"] = "cannot_connect"
else: else:
if bool(self._selected_tunnel.tunnelling_requires_secure) is not ( 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 ( ) or (
selected_tunnelling_type == CONF_KNX_TUNNELING_TCP selected_tunneling_type == CONF_KNX_TUNNELING_TCP
and not self._selected_tunnel.supports_tunnelling_tcp and not self._selected_tunnel.supports_tunnelling_tcp
): ):
errors[CONF_KNX_TUNNELING_TYPE] = "unsupported_tunnel_type" errors[CONF_KNX_TUNNELING_TYPE] = "unsupported_tunnel_type"
if not errors: if not errors:
self.new_entry_data = KNXConfigEntryData( self.new_entry_data = KNXConfigEntryData(
connection_type=selected_tunnelling_type, connection_type=selected_tunneling_type,
host=_host, host=_host,
port=user_input[CONF_PORT], port=user_input[CONF_PORT],
route_back=user_input[CONF_KNX_ROUTE_BACK], route_back=user_input[CONF_KNX_ROUTE_BACK],
@ -426,11 +426,11 @@ class KNXCommonFlow(ABC, ConfigEntryBaseFlow):
tunnel_endpoint_ia=None, 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() return await self.async_step_secure_key_source_menu_tunnel()
self.new_title = ( self.new_title = (
"Tunneling " "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}" f"@ {_host}"
) )
return self.finish_flow() return self.finish_flow()
@ -497,7 +497,7 @@ class KNXCommonFlow(ABC, ConfigEntryBaseFlow):
async def async_step_secure_tunnel_manual( async def async_step_secure_tunnel_manual(
self, user_input: dict | None = None self, user_input: dict | None = None
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Configure ip secure tunnelling manually.""" """Configure ip secure tunneling manually."""
errors: dict = {} errors: dict = {}
if user_input is not None: if user_input is not None:

View File

@ -104,9 +104,9 @@ class KNXConfigEntryData(TypedDict, total=False):
multicast_group: str multicast_group: str
multicast_port: int multicast_port: int
route_back: bool # not required route_back: bool # not required
host: str # only required for tunnelling host: str # only required for tunneling
port: int # only required for tunnelling port: int # only required for tunneling
tunnel_endpoint_ia: str | None # tunnelling only - not required (use get()) tunnel_endpoint_ia: str | None # tunneling only - not required (use get())
# KNX secure # KNX secure
user_id: int | None # not required user_id: int | None # not required
user_password: str | None # not required user_password: str | None # not required

View File

@ -85,7 +85,7 @@
} }
}, },
"secure_tunnel_manual": { "secure_tunnel_manual": {
"title": "Secure tunnelling", "title": "Secure tunneling",
"description": "Please enter your IP Secure information.", "description": "Please enter your IP Secure information.",
"data": { "data": {
"user_id": "User ID", "user_id": "User ID",
@ -140,7 +140,7 @@
"keyfile_not_found": "The specified `.knxkeys` file was not found in the path config/.storage/knx/", "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_router_discovered": "No KNXnet/IP router was discovered on the network.",
"no_tunnel_discovered": "Could not find a KNX tunneling server on your 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": { "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: 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( gateway = _gateway_descriptor(
"192.168.0.1", "192.168.0.1",
3675, 3675,
@ -1082,7 +1082,7 @@ async def test_get_secure_menu_step_manual_tunnelling(
request_description_mock: MagicMock, request_description_mock: MagicMock,
hass: HomeAssistant, hass: HomeAssistant,
) -> None: ) -> 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( gateway = _gateway_descriptor(
"192.168.0.1", "192.168.0.1",
3675, 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: 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) menu_step = await _get_menu_step_secure_tunnel(hass)
result = await hass.config_entries.flow.async_configure( result = await hass.config_entries.flow.async_configure(