Small speed up to cameras (#96124)

This commit is contained in:
J. Nick Koston 2023-07-07 21:23:45 -10:00 committed by GitHub
parent e38f55fdb6
commit 51344d566e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -514,8 +514,8 @@ class Camera(Entity):
@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: