mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +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 (
|
from homeassistant.components.binary_sensor import (
|
||||||
DOMAIN as BINARY_SENSOR_DOMAIN,
|
DOMAIN as BINARY_SENSOR_DOMAIN,
|
||||||
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@ -104,6 +105,7 @@ class HuaweiLteMobileConnectionBinarySensor(HuaweiLteBaseBinarySensor):
|
|||||||
|
|
||||||
_attr_translation_key = "mobile_connection"
|
_attr_translation_key = "mobile_connection"
|
||||||
_attr_entity_registry_enabled_default = True
|
_attr_entity_registry_enabled_default = True
|
||||||
|
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
|
||||||
|
|
||||||
key = KEY_MONITORING_STATUS
|
key = KEY_MONITORING_STATUS
|
||||||
item = "ConnectionStatus"
|
item = "ConnectionStatus"
|
||||||
@ -140,6 +142,8 @@ class HuaweiLteMobileConnectionBinarySensor(HuaweiLteBaseBinarySensor):
|
|||||||
class HuaweiLteBaseWifiStatusBinarySensor(HuaweiLteBaseBinarySensor):
|
class HuaweiLteBaseWifiStatusBinarySensor(HuaweiLteBaseBinarySensor):
|
||||||
"""Huawei LTE WiFi status binary sensor base class."""
|
"""Huawei LTE WiFi status binary sensor base class."""
|
||||||
|
|
||||||
|
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
"""Return whether the binary sensor is on."""
|
"""Return whether the binary sensor is on."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user