Set TriggerBaseEntity device_class in init (#100216)
parent
f5c0c7bf27
commit
8af7475f73
|
@ -119,6 +119,7 @@ class TriggerBaseEntity(Entity):
|
|||
# We make a copy so our initial render is 'unknown' and not 'unavailable'
|
||||
self._rendered = dict(self._static_rendered)
|
||||
self._parse_result = {CONF_AVAILABILITY}
|
||||
self._attr_device_class = config.get(CONF_DEVICE_CLASS)
|
||||
|
||||
@property
|
||||
def name(self) -> str | None:
|
||||
|
@ -130,11 +131,6 @@ class TriggerBaseEntity(Entity):
|
|||
"""Return unique ID of the entity."""
|
||||
return self._unique_id
|
||||
|
||||
@property
|
||||
def device_class(self): # type: ignore[no-untyped-def]
|
||||
"""Return device class of the entity."""
|
||||
return self._config.get(CONF_DEVICE_CLASS)
|
||||
|
||||
@property
|
||||
def icon(self) -> str | None:
|
||||
"""Return icon."""
|
||||
|
|
Loading…
Reference in New Issue