use getattr instead of get (#8094)

This commit is contained in:
Josh Hawkins 2023-10-08 14:30:23 -05:00 committed by GitHub
parent e1a6398219
commit dbd21eb6fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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