onvif: use preset token if name is unsupported (#8046)

* onvif: use preset token if name is unsupported

* move parenthesis
This commit is contained in:
Josh Hawkins 2023-10-07 09:20:42 -05:00 committed by GitHub
parent 5d2b87e077
commit 67a5a7d21a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,7 +175,9 @@ class OnvifController:
presets = []
for preset in presets:
self.cams[camera_name]["presets"][preset["Name"].lower()] = preset["token"]
self.cams[camera_name]["presets"][
preset.get("Name", f"preset {preset['token']}").lower()
] = preset["token"]
# get list of supported features
ptz_config = ptz.GetConfigurationOptions(request)