mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Use walrus in event entity last event attributes (#97005)
This commit is contained in:
parent
b3da2ea9a6
commit
530556015f
@ -177,8 +177,8 @@ class EventEntity(RestoreEntity):
|
|||||||
def state_attributes(self) -> dict[str, Any]:
|
def state_attributes(self) -> dict[str, Any]:
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
attributes = {ATTR_EVENT_TYPE: self.__last_event_type}
|
attributes = {ATTR_EVENT_TYPE: self.__last_event_type}
|
||||||
if self.__last_event_attributes:
|
if last_event_attributes := self.__last_event_attributes:
|
||||||
attributes |= self.__last_event_attributes
|
attributes |= last_event_attributes
|
||||||
return attributes
|
return attributes
|
||||||
|
|
||||||
@final
|
@final
|
||||||
|
Loading…
x
Reference in New Issue
Block a user