1
mirror of https://github.com/home-assistant/core synced 2024-10-07 10:13:38 +02:00

Fix remove of device when surveillance station is not used in Synology DSM (#92957)

This commit is contained in:
Michael 2023-05-12 16:02:42 +02:00 committed by GitHub
parent 45e7283584
commit e883fef8ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,8 +147,10 @@ async def async_remove_config_entry_device(
api = data.api
serial = api.information.serial
storage = api.storage
# get_all_cameras does not do I/O
all_cameras: list[SynoCamera] = api.surveillance_station.get_all_cameras()
all_cameras: list[SynoCamera] = []
if api.surveillance_station is not None:
# get_all_cameras does not do I/O
all_cameras = api.surveillance_station.get_all_cameras()
device_ids = chain(
(camera.id for camera in all_cameras),
storage.volumes_ids,