Add support for entity category for necessary KNX platforms (#58357)
This commit is contained in:
parent
f3a1c81e22
commit
e9ca511327
13 changed files with 84 additions and 10 deletions
|
@ -11,7 +11,7 @@ from homeassistant.components.sensor import (
|
|||
DEVICE_CLASSES,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_NAME, CONF_TYPE
|
||||
from homeassistant.const import CONF_ENTITY_CATEGORY, CONF_NAME, CONF_TYPE
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType, StateType
|
||||
|
@ -65,6 +65,7 @@ class KNXSensor(KnxEntity, SensorEntity):
|
|||
else None
|
||||
)
|
||||
self._attr_force_update = self._device.always_callback
|
||||
self._attr_entity_category = config.get(CONF_ENTITY_CATEGORY)
|
||||
self._attr_unique_id = str(self._device.sensor_value.group_address_state)
|
||||
self._attr_native_unit_of_measurement = self._device.unit_of_measurement()
|
||||
self._attr_state_class = config.get(CONF_STATE_CLASS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue