mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +00:00
Avoid duplicate property lookups in camera state_attributes (#107627)
This commit is contained in:
parent
955c70b8f1
commit
a0b00d78b1
@ -726,17 +726,17 @@ class Camera(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
|
|||||||
"""Return the camera state attributes."""
|
"""Return the camera state attributes."""
|
||||||
attrs = {"access_token": self.access_tokens[-1]}
|
attrs = {"access_token": self.access_tokens[-1]}
|
||||||
|
|
||||||
if self.model:
|
if model := self.model:
|
||||||
attrs["model_name"] = self.model
|
attrs["model_name"] = model
|
||||||
|
|
||||||
if self.brand:
|
if brand := self.brand:
|
||||||
attrs["brand"] = self.brand
|
attrs["brand"] = brand
|
||||||
|
|
||||||
if self.motion_detection_enabled:
|
if motion_detection_enabled := self.motion_detection_enabled:
|
||||||
attrs["motion_detection"] = self.motion_detection_enabled
|
attrs["motion_detection"] = motion_detection_enabled
|
||||||
|
|
||||||
if self.frontend_stream_type:
|
if frontend_stream_type := self.frontend_stream_type:
|
||||||
attrs["frontend_stream_type"] = self.frontend_stream_type
|
attrs["frontend_stream_type"] = frontend_stream_type
|
||||||
|
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user