Check Surveillance Station permissions during setup of Synology DSM integration (#78884)
parent
c4eafb98fa
commit
2c08dc509f
|
@ -91,6 +91,16 @@ class SynoApi:
|
||||||
self._with_surveillance_station = bool(
|
self._with_surveillance_station = bool(
|
||||||
self.dsm.apis.get(SynoSurveillanceStation.CAMERA_API_KEY)
|
self.dsm.apis.get(SynoSurveillanceStation.CAMERA_API_KEY)
|
||||||
)
|
)
|
||||||
|
if self._with_surveillance_station:
|
||||||
|
try:
|
||||||
|
self.dsm.surveillance_station.update()
|
||||||
|
except SYNOLOGY_CONNECTION_EXCEPTIONS:
|
||||||
|
self._with_surveillance_station = False
|
||||||
|
self.dsm.reset(SynoSurveillanceStation.API_KEY)
|
||||||
|
LOGGER.info(
|
||||||
|
"Surveillance Station found, but disabled due to missing user permissions"
|
||||||
|
)
|
||||||
|
|
||||||
LOGGER.debug(
|
LOGGER.debug(
|
||||||
"State of Surveillance_station during setup of '%s': %s",
|
"State of Surveillance_station during setup of '%s': %s",
|
||||||
self._entry.unique_id,
|
self._entry.unique_id,
|
||||||
|
|
Loading…
Reference in New Issue