From 3e889616f20a8a8261acb2bab89eb2e60cea5dd6 Mon Sep 17 00:00:00 2001 From: Craig Callender <125502786+CraigCallender@users.noreply.github.com> Date: Tue, 23 Dec 2025 00:47:10 +0100 Subject: [PATCH] Remove 'hair_pinning' from Tailscale (#156728) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: AbĂ­lio Costa --- .../components/tailscale/binary_sensor.py | 10 ----- homeassistant/components/tailscale/icons.json | 3 -- .../components/tailscale/strings.json | 3 -- .../tailscale/test_binary_sensor.py | 38 +------------------ 4 files changed, 1 insertion(+), 53 deletions(-) diff --git a/homeassistant/components/tailscale/binary_sensor.py b/homeassistant/components/tailscale/binary_sensor.py index 65ac69d89c7..c17b6c0d984 100644 --- a/homeassistant/components/tailscale/binary_sensor.py +++ b/homeassistant/components/tailscale/binary_sensor.py @@ -42,16 +42,6 @@ BINARY_SENSORS: tuple[TailscaleBinarySensorEntityDescription, ...] = ( entity_category=EntityCategory.DIAGNOSTIC, is_on_fn=lambda device: device.key_expiry_disabled, ), - TailscaleBinarySensorEntityDescription( - key="client_supports_hair_pinning", - translation_key="client_supports_hair_pinning", - entity_category=EntityCategory.DIAGNOSTIC, - is_on_fn=lambda device: ( - device.client_connectivity.client_supports.hair_pinning - if device.client_connectivity is not None - else None - ), - ), TailscaleBinarySensorEntityDescription( key="client_supports_ipv6", translation_key="client_supports_ipv6", diff --git a/homeassistant/components/tailscale/icons.json b/homeassistant/components/tailscale/icons.json index a5d3bec1884..235847ec821 100644 --- a/homeassistant/components/tailscale/icons.json +++ b/homeassistant/components/tailscale/icons.json @@ -1,9 +1,6 @@ { "entity": { "binary_sensor": { - "client_supports_hair_pinning": { - "default": "mdi:wan" - }, "client_supports_ipv6": { "default": "mdi:wan" }, diff --git a/homeassistant/components/tailscale/strings.json b/homeassistant/components/tailscale/strings.json index dec388b974e..12b910639fc 100644 --- a/homeassistant/components/tailscale/strings.json +++ b/homeassistant/components/tailscale/strings.json @@ -29,9 +29,6 @@ "client": { "name": "Client" }, - "client_supports_hair_pinning": { - "name": "Supports hairpinning" - }, "client_supports_ipv6": { "name": "Supports IPv6" }, diff --git a/tests/components/tailscale/test_binary_sensor.py b/tests/components/tailscale/test_binary_sensor.py index e0ac97865f0..2c47512fcb7 100644 --- a/tests/components/tailscale/test_binary_sensor.py +++ b/tests/components/tailscale/test_binary_sensor.py @@ -6,12 +6,7 @@ from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, ) from homeassistant.components.tailscale.const import DOMAIN -from homeassistant.const import ( - ATTR_DEVICE_CLASS, - ATTR_FRIENDLY_NAME, - STATE_UNKNOWN, - EntityCategory, -) +from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_FRIENDLY_NAME, EntityCategory from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr, entity_registry as er @@ -49,21 +44,6 @@ async def test_tailscale_binary_sensors( ) assert ATTR_DEVICE_CLASS not in state.attributes - state = hass.states.get("binary_sensor.frencks_iphone_supports_hairpinning") - entry = entity_registry.async_get( - "binary_sensor.frencks_iphone_supports_hairpinning" - ) - assert entry - assert state - assert entry.unique_id == "123456_client_supports_hair_pinning" - assert entry.entity_category == EntityCategory.DIAGNOSTIC - assert state.state == STATE_OFF - assert ( - state.attributes.get(ATTR_FRIENDLY_NAME) - == "frencks-iphone Supports hairpinning" - ) - assert ATTR_DEVICE_CLASS not in state.attributes - state = hass.states.get("binary_sensor.frencks_iphone_supports_ipv6") entry = entity_registry.async_get("binary_sensor.frencks_iphone_supports_ipv6") assert entry @@ -127,19 +107,3 @@ async def test_tailscale_binary_sensors( device_entry.configuration_url == "https://login.tailscale.com/admin/machines/100.11.11.111" ) - - # Check host without client connectivity attribute - state = hass.states.get("binary_sensor.host_no_connectivity_supports_hairpinning") - entry = entity_registry.async_get( - "binary_sensor.host_no_connectivity_supports_hairpinning" - ) - assert entry - assert state - assert entry.unique_id == "123458_client_supports_hair_pinning" - assert entry.entity_category == EntityCategory.DIAGNOSTIC - assert state.state == STATE_UNKNOWN - assert ( - state.attributes.get(ATTR_FRIENDLY_NAME) - == "host-no-connectivity Supports hairpinning" - ) - assert ATTR_DEVICE_CLASS not in state.attributes