mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 05:06:13 +01:00
Remove 'hair_pinning' from Tailscale (#156728)
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"client_supports_hair_pinning": {
|
||||
"default": "mdi:wan"
|
||||
},
|
||||
"client_supports_ipv6": {
|
||||
"default": "mdi:wan"
|
||||
},
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
"client": {
|
||||
"name": "Client"
|
||||
},
|
||||
"client_supports_hair_pinning": {
|
||||
"name": "Supports hairpinning"
|
||||
},
|
||||
"client_supports_ipv6": {
|
||||
"name": "Supports IPv6"
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user