Skip to content

Commit

Permalink
Add SetSynchronizationPoint fallback to onvif (home-assistant#86400)
Browse files Browse the repository at this point in the history
Co-authored-by: J. Nick Koston <[email protected]>
  • Loading branch information
GrumpyMeow and bdraco authored Apr 15, 2023
1 parent 72dfd95 commit 963648a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions homeassistant/components/onvif/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
from .parsers import PARSERS

UNHANDLED_TOPICS: set[str] = set()
SUBSCRIPTION_ERRORS = (
Fault,
asyncio.TimeoutError,
TransportError,
)

SUBSCRIPTION_ERRORS = (Fault, asyncio.TimeoutError, TransportError)
SET_SYNCHRONIZATION_POINT_ERRORS = (*SUBSCRIPTION_ERRORS, TypeError)


def _stringify_onvif_error(error: Exception) -> str:
Expand Down Expand Up @@ -110,7 +108,7 @@ async def async_start(self) -> bool:

# Initialize events
pullpoint = self.device.create_pullpoint_service()
with suppress(*SUBSCRIPTION_ERRORS):
with suppress(*SET_SYNCHRONIZATION_POINT_ERRORS):
await pullpoint.SetSynchronizationPoint()
response = await pullpoint.PullMessages(
{"MessageLimit": 100, "Timeout": dt.timedelta(seconds=5)}
Expand Down

0 comments on commit 963648a

Please sign in to comment.