Enforce CameraEntityFeature (#82325)

This commit is contained in:
epenet 2022-11-22 07:08:28 +01:00 committed by GitHub
parent 7df711f1f3
commit 8b54a0679f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 10 deletions

View file

@ -175,9 +175,10 @@ class ProtectCamera(ProtectDeviceEntity, Camera):
self._stream_source = ( # pylint: disable=attribute-defined-outside-init
None if disable_stream else rtsp_url
)
self._attr_supported_features = (
CameraEntityFeature.STREAM if self._stream_source else 0
)
if self._stream_source:
self._attr_supported_features = CameraEntityFeature.STREAM
else:
self._attr_supported_features = CameraEntityFeature(0)
@callback
def _async_update_device_from_protect(self, device: ProtectModelWithId) -> None: