Hive add entity categories to entities (#74324)

add enitity categories to entities
This commit is contained in:
Khole 2022-07-02 13:33:10 +01:00 committed by GitHub
parent 647a023776
commit 255c3c5b9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -10,6 +10,7 @@ from homeassistant.components.sensor import (
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, POWER_KILO_WATT
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import HiveEntity
@ -23,12 +24,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
key="Battery",
native_unit_of_measurement=PERCENTAGE,
device_class=SensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC,
),
SensorEntityDescription(
key="Power",
native_unit_of_measurement=POWER_KILO_WATT,
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.POWER,
entity_category=EntityCategory.DIAGNOSTIC,
),
)