Add entity categories for appropriate Guardian entities (#58104)

This commit is contained in:
Aaron Bach 2021-10-20 15:58:09 -06:00 committed by GitHub
parent 03b1150115
commit 388761922b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -9,6 +9,7 @@ from homeassistant.components.binary_sensor import (
BinarySensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -36,6 +37,7 @@ SENSOR_DESCRIPTION_AP_ENABLED = BinarySensorEntityDescription(
key=SENSOR_KIND_AP_INFO,
name="Onboard AP Enabled",
device_class=DEVICE_CLASS_CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
)
SENSOR_DESCRIPTION_LEAK_DETECTED = BinarySensorEntityDescription(
key=SENSOR_KIND_LEAK_DETECTED,
@ -46,6 +48,7 @@ SENSOR_DESCRIPTION_MOVED = BinarySensorEntityDescription(
key=SENSOR_KIND_MOVED,
name="Recently Moved",
device_class=DEVICE_CLASS_MOVING,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
)
PAIRED_SENSOR_DESCRIPTIONS = (

View File

@ -10,6 +10,7 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_TEMPERATURE,
ENTITY_CATEGORY_DIAGNOSTIC,
PERCENTAGE,
TEMP_FAHRENHEIT,
TIME_MINUTES,
@ -38,6 +39,7 @@ SENSOR_DESCRIPTION_BATTERY = SensorEntityDescription(
key=SENSOR_KIND_BATTERY,
name="Battery",
device_class=DEVICE_CLASS_BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
)
SENSOR_DESCRIPTION_TEMPERATURE = SensorEntityDescription(
@ -51,6 +53,7 @@ SENSOR_DESCRIPTION_UPTIME = SensorEntityDescription(
key=SENSOR_KIND_UPTIME,
name="Uptime",
icon="mdi:timer",
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
native_unit_of_measurement=TIME_MINUTES,
)