Turning on more lint checkers, warning for cameras that ignore resolution setting

This commit is contained in:
Julian Stirling 2025-06-10 13:57:34 +01:00
parent ae2ec1864f
commit 3f0564f253
3 changed files with 6 additions and 2 deletions

View file

@ -111,8 +111,8 @@ select = [
# "RET", # Consistent clear return statments
"RSE", # Raise parentheses
# "SIM", # Simplifications detected
# "ARG", # unused arguments
# "C90", # McCabe complexity!
"ARG", # unused arguments
"C90", # McCabe complexity!
"NPY", # Numpy linting
"N", # PEP8 naming
# "DOC", # Enforce argument, return, and raise to be mentioned in docstrings there is

View file

@ -83,6 +83,7 @@ class OpenCVCamera(BaseCamera):
It's likely to be highly inefficient - raw and/or uncompressed captures using
binary image formats will be added in due course.
"""
logging.warning(f"OpenCV camera doen't respect {resolution} setting")
ret, frame = self.cap.read()
if not ret:
raise RuntimeError(
@ -100,6 +101,7 @@ class OpenCVCamera(BaseCamera):
This function will produce a JPEG image.
"""
logging.warning(f"OpenCV camera doen't respect {resolution} setting")
frame = self.capture_array()
jpeg = cv2.imencode(".jpg", frame)[1].tobytes()
exif_dict = {

View file

@ -189,6 +189,7 @@ class SimulatedCamera(BaseCamera):
It's likely to be highly inefficient - raw and/or uncompressed captures using
binary image formats will be added in due course.
"""
logging.warning(f"Simulation camera doen't respect {resolution} setting")
return self.generate_frame()
@thing_action
@ -201,6 +202,7 @@ class SimulatedCamera(BaseCamera):
This function will produce a JPEG image.
"""
logging.warning(f"Simulation camera doen't respect {resolution} setting")
frame = self.capture_array()
jpeg = cv2.imencode(".jpg", frame)[1].tobytes()
exif_dict = {