mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Add guards to onvif for when the PullPoint to Webhook url changes (#91886)
This commit is contained in:
parent
6c024405a6
commit
ddb3955a23
@ -432,7 +432,10 @@ class PullPointManager:
|
|||||||
|
|
||||||
async def _async_unsubscribe_pullpoint(self) -> None:
|
async def _async_unsubscribe_pullpoint(self) -> None:
|
||||||
"""Unsubscribe the pullpoint subscription."""
|
"""Unsubscribe the pullpoint subscription."""
|
||||||
if not self._pullpoint_subscription:
|
if (
|
||||||
|
not self._pullpoint_subscription
|
||||||
|
or self._pullpoint_subscription.transport.client.is_closed
|
||||||
|
):
|
||||||
return
|
return
|
||||||
LOGGER.debug("%s: Unsubscribing from PullPoint", self._name)
|
LOGGER.debug("%s: Unsubscribing from PullPoint", self._name)
|
||||||
try:
|
try:
|
||||||
@ -450,7 +453,10 @@ class PullPointManager:
|
|||||||
|
|
||||||
async def _async_renew_pullpoint(self) -> bool:
|
async def _async_renew_pullpoint(self) -> bool:
|
||||||
"""Renew the PullPoint subscription."""
|
"""Renew the PullPoint subscription."""
|
||||||
if not self._pullpoint_subscription:
|
if (
|
||||||
|
not self._pullpoint_subscription
|
||||||
|
or self._pullpoint_subscription.transport.client.is_closed
|
||||||
|
):
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
# The first time we renew, we may get a Fault error so we
|
# The first time we renew, we may get a Fault error so we
|
||||||
@ -702,7 +708,10 @@ class WebHookManager:
|
|||||||
|
|
||||||
async def _async_renew_webhook(self) -> bool:
|
async def _async_renew_webhook(self) -> bool:
|
||||||
"""Renew webhook subscription."""
|
"""Renew webhook subscription."""
|
||||||
if not self._webhook_subscription:
|
if (
|
||||||
|
not self._webhook_subscription
|
||||||
|
or self._webhook_subscription.transport.client.is_closed
|
||||||
|
):
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
@ -839,7 +848,10 @@ class WebHookManager:
|
|||||||
|
|
||||||
async def _async_unsubscribe_webhook(self) -> None:
|
async def _async_unsubscribe_webhook(self) -> None:
|
||||||
"""Unsubscribe from the webhook."""
|
"""Unsubscribe from the webhook."""
|
||||||
if not self._webhook_subscription:
|
if (
|
||||||
|
not self._webhook_subscription
|
||||||
|
or self._webhook_subscription.transport.client.is_closed
|
||||||
|
):
|
||||||
return
|
return
|
||||||
LOGGER.debug("%s: Unsubscribing from webhook", self._name)
|
LOGGER.debug("%s: Unsubscribing from webhook", self._name)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user