mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
ONVIF: Add check around media capabilities (#35667)
This commit is contained in:
parent
7e56f2cc0e
commit
3a3f39b642
@ -207,8 +207,13 @@ class ONVIFDevice:
|
|||||||
|
|
||||||
async def async_get_capabilities(self):
|
async def async_get_capabilities(self):
|
||||||
"""Obtain information about the available services on the device."""
|
"""Obtain information about the available services on the device."""
|
||||||
media_service = self.device.create_media_service()
|
snapshot = False
|
||||||
media_capabilities = await media_service.GetServiceCapabilities()
|
try:
|
||||||
|
media_service = self.device.create_media_service()
|
||||||
|
media_capabilities = await media_service.GetServiceCapabilities()
|
||||||
|
snapshot = media_capabilities.SnapshotUri
|
||||||
|
except (ONVIFError, Fault):
|
||||||
|
pass
|
||||||
|
|
||||||
pullpoint = False
|
pullpoint = False
|
||||||
try:
|
try:
|
||||||
@ -225,7 +230,7 @@ class ONVIFDevice:
|
|||||||
except ONVIFError:
|
except ONVIFError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return Capabilities(media_capabilities.SnapshotUri, pullpoint, ptz)
|
return Capabilities(snapshot, pullpoint, ptz)
|
||||||
|
|
||||||
async def async_get_profiles(self) -> List[Profile]:
|
async def async_get_profiles(self) -> List[Profile]:
|
||||||
"""Obtain media profiles for this device."""
|
"""Obtain media profiles for this device."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user