Add class attribute for capability attributes in entity base class (#76599)

pull/76607/head
Franck Nijhof 2022-08-11 10:34:58 +02:00 committed by GitHub
parent 6ad2708946
commit a30dfd9f3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -274,6 +274,7 @@ class Entity(ABC):
_attr_assumed_state: bool = False
_attr_attribution: str | None = None
_attr_available: bool = True
_attr_capability_attributes: Mapping[str, Any] | None = None
_attr_context_recent_time: timedelta = timedelta(seconds=5)
_attr_device_class: str | None
_attr_device_info: DeviceInfo | None = None
@ -337,7 +338,7 @@ class Entity(ABC):
Implemented by component base class. Convention for attribute names
is lowercase snake_case.
"""
return None
return self._attr_capability_attributes
@property
def state_attributes(self) -> dict[str, Any] | None: