Add entity category to august (#58359)
This commit is contained in:
parent
79f68b050a
commit
d05127cb71
2 changed files with 10 additions and 1 deletions
|
@ -26,6 +26,7 @@ from homeassistant.components.binary_sensor import (
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
BinarySensorEntityDescription,
|
BinarySensorEntityDescription,
|
||||||
)
|
)
|
||||||
|
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.helpers.event import async_call_later
|
from homeassistant.helpers.event import async_call_later
|
||||||
|
|
||||||
|
@ -129,6 +130,7 @@ SENSOR_TYPES_DOORBELL: tuple[AugustBinarySensorEntityDescription, ...] = (
|
||||||
key="doorbell_online",
|
key="doorbell_online",
|
||||||
name="Online",
|
name="Online",
|
||||||
device_class=DEVICE_CLASS_CONNECTIVITY,
|
device_class=DEVICE_CLASS_CONNECTIVITY,
|
||||||
|
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
value_fn=_retrieve_online_state,
|
value_fn=_retrieve_online_state,
|
||||||
is_time_based=False,
|
is_time_based=False,
|
||||||
),
|
),
|
||||||
|
|
|
@ -16,7 +16,12 @@ from homeassistant.components.sensor import (
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.const import ATTR_ENTITY_PICTURE, PERCENTAGE, STATE_UNAVAILABLE
|
from homeassistant.const import (
|
||||||
|
ATTR_ENTITY_PICTURE,
|
||||||
|
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
|
PERCENTAGE,
|
||||||
|
STATE_UNAVAILABLE,
|
||||||
|
)
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.helpers.entity_registry import async_get_registry
|
from homeassistant.helpers.entity_registry import async_get_registry
|
||||||
from homeassistant.helpers.restore_state import RestoreEntity
|
from homeassistant.helpers.restore_state import RestoreEntity
|
||||||
|
@ -68,12 +73,14 @@ class AugustSensorEntityDescription(
|
||||||
SENSOR_TYPE_DEVICE_BATTERY = AugustSensorEntityDescription[LockDetail](
|
SENSOR_TYPE_DEVICE_BATTERY = AugustSensorEntityDescription[LockDetail](
|
||||||
key="device_battery",
|
key="device_battery",
|
||||||
name="Battery",
|
name="Battery",
|
||||||
|
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
value_fn=_retrieve_device_battery_state,
|
value_fn=_retrieve_device_battery_state,
|
||||||
)
|
)
|
||||||
|
|
||||||
SENSOR_TYPE_KEYPAD_BATTERY = AugustSensorEntityDescription[KeypadDetail](
|
SENSOR_TYPE_KEYPAD_BATTERY = AugustSensorEntityDescription[KeypadDetail](
|
||||||
key="linked_keypad_battery",
|
key="linked_keypad_battery",
|
||||||
name="Battery",
|
name="Battery",
|
||||||
|
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
value_fn=_retrieve_linked_keypad_battery_state,
|
value_fn=_retrieve_linked_keypad_battery_state,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue