Fix Reolink setup when ONVIF push is unsupported (#144869)

* Fix setup when ONVIF push is not supported

* fix styling
This commit is contained in:
starkillerOG 2025-05-14 11:58:29 +02:00 committed by GitHub
parent 30ecba9944
commit 5acae7f86d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -581,7 +581,12 @@ class ReolinkHost:
)
return
await self._api.subscribe(self._webhook_url)
try:
await self._api.subscribe(self._webhook_url)
except NotSupportedError as err:
self._onvif_push_supported = False
_LOGGER.debug(err)
return
_LOGGER.debug(
"Host %s: subscribed successfully to webhook %s",
@ -602,7 +607,11 @@ class ReolinkHost:
return # API is shutdown, no need to subscribe
try:
if self._onvif_push_supported and not self._api.baichuan.events_active:
if (
self._onvif_push_supported
and not self._api.baichuan.events_active
and self._cancel_tcp_push_check is None
):
await self._renew(SubType.push)
if self._onvif_long_poll_supported and self._long_poll_task is not None: