mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Set device class for huawei_lte connectivity binary sensors (#143764)
This commit is contained in:
parent
7a0580eff5
commit
d28f4ed618
@ -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."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user