Don't fail if camera does not support presets (#6497)

This commit is contained in:
Nicolas Mowen 2023-05-17 06:42:56 -06:00 committed by GitHub
parent b4038821cc
commit b568a29fa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,8 +79,8 @@ class OnvifController:
try: try:
presets: list[dict] = ptz.GetPresets({"ProfileToken": profile.token}) presets: list[dict] = ptz.GetPresets({"ProfileToken": profile.token})
except ONVIFError as e: except ONVIFError as e:
logger.error(f"Unable to get presets from camera: {camera_name}: {e}") logger.warning(f"Unable to get presets from camera: {camera_name}: {e}")
return False presets = []
for preset in presets: for preset in presets:
self.cams[camera_name]["presets"][preset["Name"].lower()] = preset["token"] self.cams[camera_name]["presets"][preset["Name"].lower()] = preset["token"]