From 11a90016d07c774fe2237e43d3d8624564fab950 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 19 Sep 2023 12:08:13 +0200 Subject: [PATCH] Change Hue zigbee connectivity sensor into an enum (#98632) --- homeassistant/components/hue/strings.json | 10 ++++++++++ homeassistant/components/hue/v2/sensor.py | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/homeassistant/components/hue/strings.json b/homeassistant/components/hue/strings.json index 326d08d1f7a..1224abb240e 100644 --- a/homeassistant/components/hue/strings.json +++ b/homeassistant/components/hue/strings.json @@ -94,6 +94,16 @@ } } } + }, + "sensor": { + "zigbee_connectivity": { + "state": { + "connected": "[%key:common::state::connected%]", + "disconnected": "[%key:common::state::disconnected%]", + "connectivity_issue": "Connectivity issue", + "unidirectional_incoming": "Unidirectional incoming" + } + } } }, "options": { diff --git a/homeassistant/components/hue/v2/sensor.py b/homeassistant/components/hue/v2/sensor.py index dcdae0a3294..cc36edb88b2 100644 --- a/homeassistant/components/hue/v2/sensor.py +++ b/homeassistant/components/hue/v2/sensor.py @@ -156,6 +156,14 @@ class HueZigbeeConnectivitySensor(HueSensorBase): """Representation of a Hue ZigbeeConnectivity sensor.""" _attr_entity_category = EntityCategory.DIAGNOSTIC + _attr_translation_key = "zigbee_connectivity" + _attr_device_class = SensorDeviceClass.ENUM + _attr_options = [ + "connected", + "disconnected", + "connectivity_issue", + "unidirectional_incoming", + ] _attr_entity_registry_enabled_default = False @property