Skip to content

Commit

Permalink
Set TriggerBaseEntity device_class in init (#100216)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Sep 12, 2023
1 parent f5c0c7b commit 8af7475
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions homeassistant/helpers/trigger_template_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def __init__(
# 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:
Expand All @@ -130,11 +131,6 @@ def unique_id(self) -> str | None:
"""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."""
Expand Down

0 comments on commit 8af7475

Please sign in to comment.