Fjaraskupan entity categories (#57846)

This commit is contained in:
Joakim Plate
2021-10-22 10:50:21 +02:00
committed by GitHub
parent 547e36ae94
commit c0934ce03c

View File

@@ -9,7 +9,10 @@ from homeassistant.components.sensor import (
SensorEntity, SensorEntity,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import SIGNAL_STRENGTH_DECIBELS_MILLIWATT from homeassistant.const import (
ENTITY_CATEGORY_DIAGNOSTIC,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
)
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo, Entity from homeassistant.helpers.entity import DeviceInfo, Entity
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
@@ -57,6 +60,7 @@ class RssiSensor(CoordinatorEntity[State], SensorEntity):
self._attr_state_class = STATE_CLASS_MEASUREMENT self._attr_state_class = STATE_CLASS_MEASUREMENT
self._attr_native_unit_of_measurement = SIGNAL_STRENGTH_DECIBELS_MILLIWATT self._attr_native_unit_of_measurement = SIGNAL_STRENGTH_DECIBELS_MILLIWATT
self._attr_entity_registry_enabled_default = False self._attr_entity_registry_enabled_default = False
self._attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
@property @property
def native_value(self) -> StateType: def native_value(self) -> StateType: