Fix update of surveillance_station data in Synology DSM (#47966)

This commit is contained in:
Michael 2021-03-31 17:18:58 +02:00 committed by GitHub
parent 9fd6980144
commit 949cd4714a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -441,12 +441,11 @@ class SynoApi:
)
return
# surveillance_station is updated by own coordinator
self.dsm.reset(self.surveillance_station)
# Determine if we should fetch an API
self._with_system = bool(self.dsm.apis.get(SynoCoreSystem.API_KEY))
self._with_surveillance_station = bool(
self.dsm.apis.get(SynoSurveillanceStation.CAMERA_API_KEY)
) or bool(self.dsm.apis.get(SynoSurveillanceStation.HOME_MODE_API_KEY))
self._with_security = bool(
self._fetching_entities.get(SynoCoreSecurity.API_KEY)
)
@ -497,14 +496,6 @@ class SynoApi:
self.dsm.reset(self.utilisation)
self.utilisation = None
if not self._with_surveillance_station:
_LOGGER.debug(
"Disable surveillance_station api from being updated for '%s'",
self._entry.unique_id,
)
self.dsm.reset(self.surveillance_station)
self.surveillance_station = None
def _fetch_device_configuration(self):
"""Fetch initial device config."""
self.information = self.dsm.information