diff --git a/homeassistant/core.py b/homeassistant/core.py index da40c17c411..14699aba33e 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -759,6 +759,7 @@ class State: last_changed: last time the state was changed, not the attributes. last_updated: last time this object was updated. context: Context in which it was created + domain: Domain of this state. """ __slots__ = [ @@ -768,6 +769,7 @@ class State: "last_changed", "last_updated", "context", + "domain", ] def __init__( @@ -801,11 +803,7 @@ class State: self.last_updated = last_updated or dt_util.utcnow() self.last_changed = last_changed or self.last_updated self.context = context or Context() - - @property - def domain(self) -> str: - """Domain of this state.""" - return split_entity_id(self.entity_id)[0] + self.domain = split_entity_id(self.entity_id)[0] @property def object_id(self) -> str: