webcam: fix boolean updates

In Python a "bool" is a subclass of int.  When introspecting
a webcam's attributes it is necessary to check for booleans
before integers.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-07-28 15:24:38 -04:00
parent 937c766ded
commit a22033ac49
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B

View File

@ -335,12 +335,12 @@ class WebCam:
attr = getattr(self, field)
except AttributeError:
continue
if isinstance(attr, int):
val: Any = web_request.get_int(field)
if isinstance(attr, bool):
val: Any = web_request.get_boolean(field)
elif isinstance(attr, int):
val = web_request.get_int(field)
elif isinstance(attr, float):
val = web_request.get_float(field)
elif isinstance(attr, bool):
val = web_request.get_boolean(field)
elif isinstance(attr, str):
val = web_request.get_str(field)
else: