mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 21:55:10 +02:00
Use walrus in event entity last event attributes (#97005)
This commit is contained in:
@@ -177,8 +177,8 @@ class EventEntity(RestoreEntity):
|
||||
def state_attributes(self) -> dict[str, Any]:
|
||||
"""Return the state attributes."""
|
||||
attributes = {ATTR_EVENT_TYPE: self.__last_event_type}
|
||||
if self.__last_event_attributes:
|
||||
attributes |= self.__last_event_attributes
|
||||
if last_event_attributes := self.__last_event_attributes:
|
||||
attributes |= last_event_attributes
|
||||
return attributes
|
||||
|
||||
@final
|
||||
|
Reference in New Issue
Block a user