Fix check if Surveillance Station is available in Synology DSM (#84140)

start coordinator only when surveillance_station is avialble during api setup
pull/84166/head
Michael 2022-12-18 01:43:18 +01:00 committed by GitHub
parent a3ab6a99e3
commit 5f160be8f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -98,7 +98,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# The central coordinator needs to be refreshed first since
# the next two rely on data from it
coordinator_cameras: SynologyDSMCameraUpdateCoordinator | None = None
if SynoSurveillanceStation.CAMERA_API_KEY in available_apis:
if api.surveillance_station is not None:
coordinator_cameras = SynologyDSMCameraUpdateCoordinator(hass, entry, api)
await coordinator_cameras.async_config_entry_first_refresh()