Apply suggestions from code review of branch camera-and-bg-detect-setting-customisation

This commit is contained in:
Julian Stirling 2025-08-04 22:44:40 +00:00
parent d994119b36
commit 7231e1cf5b
2 changed files with 9 additions and 4 deletions

View file

@ -33,13 +33,18 @@ class BackgroundDetectorStatus(BaseModel):
need different initialisation.
"""
settings: dict[str, Any]
"""The settings for this this background detect Algorithm. These are a dictionary
"""The settings for the current background detect Algorithm. These are a dictionary
dumped from the base model."""
# Setting schema is a dict until LabThings FastAPI issue #154 is fixed and
# DataSchema can be used directly. For now `model_dump()` must be used to dump schema
# to a dict.
settings_schema: dict[str, Any]
"""The schema for the settings for the current background detect Algorithm.
This is reported so that the UI can dynamically create a UI for any background detector
algorithm.
"""
class BackgroundDetectAlgorithm:

View file

@ -74,12 +74,12 @@ def _get_clean_camera_description(camera_thing):
def test_thing_description_equivalence(mock_picam_thing):
"""Ensure extra actions and properties are not added to camera Things without explicit approval.
"""Ensure the built-in camera Thing subclasses retain consistent core functionality.
This test verifies that extra actions are not unintentionally introduced to
camera child classes. Any addition of actions must be accompanied by an update
to this test, prompting review and justification for why the action does not
belong to the general base class.
to this test, prompting discussion of whether the action belongs in the subclass
or the base camera class.
"""
base_td = BaseCamera().thing_description()
base_actions = set(base_td.actions.keys())