From d28f4ed618ed36da07d6130982abd4c6675633c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 27 Apr 2025 17:34:11 +0300 Subject: [PATCH] Set device class for huawei_lte connectivity binary sensors (#143764) --- homeassistant/components/huawei_lte/binary_sensor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/huawei_lte/binary_sensor.py b/homeassistant/components/huawei_lte/binary_sensor.py index c3434dd0b64..41f4638b713 100644 --- a/homeassistant/components/huawei_lte/binary_sensor.py +++ b/homeassistant/components/huawei_lte/binary_sensor.py @@ -9,6 +9,7 @@ from huawei_lte_api.enums.cradle import ConnectionStatusEnum from homeassistant.components.binary_sensor import ( DOMAIN as BINARY_SENSOR_DOMAIN, + BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.config_entries import ConfigEntry @@ -104,6 +105,7 @@ class HuaweiLteMobileConnectionBinarySensor(HuaweiLteBaseBinarySensor): _attr_translation_key = "mobile_connection" _attr_entity_registry_enabled_default = True + _attr_device_class = BinarySensorDeviceClass.CONNECTIVITY key = KEY_MONITORING_STATUS item = "ConnectionStatus" @@ -140,6 +142,8 @@ class HuaweiLteMobileConnectionBinarySensor(HuaweiLteBaseBinarySensor): class HuaweiLteBaseWifiStatusBinarySensor(HuaweiLteBaseBinarySensor): """Huawei LTE WiFi status binary sensor base class.""" + _attr_device_class = BinarySensorDeviceClass.CONNECTIVITY + @property def is_on(self) -> bool: """Return whether the binary sensor is on."""