From 51344d566e09372e967804f43ceed7f48e33cce6 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 7 Jul 2023 21:23:45 -1000 Subject: [PATCH] Small speed up to cameras (#96124) --- homeassistant/components/camera/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/camera/__init__.py b/homeassistant/components/camera/__init__.py index b22e2996f7e42c..277aa10075e231 100644 --- a/homeassistant/components/camera/__init__.py +++ b/homeassistant/components/camera/__init__.py @@ -514,8 +514,8 @@ def frontend_stream_type(self) -> StreamType | None: @property def available(self) -> bool: """Return True if entity is available.""" - if self.stream and not self.stream.available: - return self.stream.available + if (stream := self.stream) and not stream.available: + return False return super().available async def async_create_stream(self) -> Stream | None: