From 05f92b9b3301fc72fa0a1656f6e964504f8fade9 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 1 Apr 2026 09:24:21 +0100 Subject: [PATCH] Specify the feature branch of LabThings and enable the feature flag. I've put the feature flag in `openflexure_microscope_server.things.__init__` so that we only need it once, rather than next to every Thing definition. I decided it was better here than, for example, in the server or cli modules because this way we still get the feature flags even if the Things are served from a different LabThings server. --- src/openflexure_microscope_server/things/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openflexure_microscope_server/things/__init__.py b/src/openflexure_microscope_server/things/__init__.py index c497209f..838e649c 100644 --- a/src/openflexure_microscope_server/things/__init__.py +++ b/src/openflexure_microscope_server/things/__init__.py @@ -9,6 +9,10 @@ from typing import Optional, Self import labthings_fastapi as lt +# To ensure consistency, we enable the feature flags we want here. This means +# they will be enabled in any code that imports a `Thing` from this package. +lt.FEATURE_FLAGS.validate_properties_on_set = True + class OFMThing(lt.Thing): """A custom LabThings Thing class for the OpenFlexure Microscope."""