diff --git a/homeassistant/components/camera/__init__.py b/homeassistant/components/camera/__init__.py index ce75f064d47..5a78728697b 100644 --- a/homeassistant/components/camera/__init__.py +++ b/homeassistant/components/camera/__init__.py @@ -726,17 +726,17 @@ class Camera(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_): """Return the camera state attributes.""" attrs = {"access_token": self.access_tokens[-1]} - if self.model: - attrs["model_name"] = self.model + if model := self.model: + attrs["model_name"] = model - if self.brand: - attrs["brand"] = self.brand + if brand := self.brand: + attrs["brand"] = brand - if self.motion_detection_enabled: - attrs["motion_detection"] = self.motion_detection_enabled + if motion_detection_enabled := self.motion_detection_enabled: + attrs["motion_detection"] = motion_detection_enabled - if self.frontend_stream_type: - attrs["frontend_stream_type"] = self.frontend_stream_type + if frontend_stream_type := self.frontend_stream_type: + attrs["frontend_stream_type"] = frontend_stream_type return attrs