Improve not shown handling (#67247)

This commit is contained in:
Paulus Schoutsen 2022-02-25 11:52:14 -08:00 committed by GitHub
parent 069e70ff03
commit 0a6c8f8e6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 2 deletions

View file

@ -81,11 +81,13 @@ class CameraMediaSource(MediaSource):
# Root. List cameras.
component: EntityComponent = self.hass.data[DOMAIN]
children = []
not_shown = 0
for camera in component.entities:
camera = cast(Camera, camera)
stream_type = camera.frontend_stream_type
if stream_type not in supported_stream_types:
not_shown += 1
continue
children.append(
@ -111,4 +113,5 @@ class CameraMediaSource(MediaSource):
can_expand=True,
children_media_class=MEDIA_CLASS_VIDEO,
children=children,
not_shown=not_shown,
)