Fix onvif ConnectionResetError (#45899)
Fix "ConnectionResetError: Cannot write to closing transport" error we can have on lots of chinese cams(like Goke GK7102 based IP cameras) Those non full onvif compliant cams can "crash" when calling non implemented functions like events or ptz and they are likely react by closing transport, leaving the request in a uncatched error state. My camera used to fail on setup, and now it run nicely with that simple fix.
This commit is contained in:
parent
1b6ee8301a
commit
8256acb8ef
1 changed files with 2 additions and 2 deletions
|
@ -250,14 +250,14 @@ class ONVIFDevice:
|
|||
pullpoint = False
|
||||
try:
|
||||
pullpoint = await self.events.async_start()
|
||||
except (ONVIFError, Fault):
|
||||
except (ONVIFError, Fault, RequestError):
|
||||
pass
|
||||
|
||||
ptz = False
|
||||
try:
|
||||
self.device.get_definition("ptz")
|
||||
ptz = True
|
||||
except ONVIFError:
|
||||
except (ONVIFError, Fault, RequestError):
|
||||
pass
|
||||
|
||||
return Capabilities(snapshot, pullpoint, ptz)
|
||||
|
|
Loading…
Add table
Reference in a new issue