Merge branch 'sangaboard-wiki' into 'v3'

Add URL to wiki if Sangaboard firmware out of date

Closes #624

See merge request openflexure/openflexure-microscope-server!486
This commit is contained in:
Julian Stirling 2026-02-17 17:56:39 +00:00
commit 00a96fec4e
2 changed files with 6 additions and 4 deletions

View file

@ -17,6 +17,7 @@ from . import BaseStage
REQUIRED_VERSION = semver.Version.parse("1.0.0")
RECOMMENDED_VERSION = semver.Version.parse("1.0.4")
WIKI_URL = "https://openflexure.miraheze.org/wiki/Sangaboard"
class SangaboardThing(BaseStage):
@ -108,14 +109,14 @@ class SangaboardThing(BaseStage):
if version < REQUIRED_VERSION:
raise RuntimeError(
f"Sangaboard firmware version {version} is below the required "
f"{REQUIRED_VERSION}."
f"{REQUIRED_VERSION}. Visit {WIKI_URL} for instructions on updating."
)
# Warn if version is below recommended
if version < RECOMMENDED_VERSION:
self.logger.warning(
f"Sangaboard firmware version {version} is below the recommended "
f"{RECOMMENDED_VERSION}."
f"{RECOMMENDED_VERSION}. Visit {WIKI_URL} for instructions on updating."
)
def _hardware_move_relative(

View file

@ -9,6 +9,7 @@ from labthings_fastapi.testing import create_thing_without_server
from openflexure_microscope_server.things.stage.sangaboard import (
RECOMMENDED_VERSION,
REQUIRED_VERSION,
WIKI_URL,
SangaboardThing,
)
@ -39,7 +40,7 @@ def test_firmware_before_recommended(mock_sanga_thing, caplog):
assert len(caplog.records) == 1
msg = (
f"Sangaboard firmware version {REQUIRED_VERSION} is below the recommended "
f"{RECOMMENDED_VERSION}."
f"{RECOMMENDED_VERSION}. Visit {WIKI_URL} for instructions on updating."
)
assert caplog.records[0].message == msg
@ -56,7 +57,7 @@ def test_dev_is_before_recommended(mock_sanga_thing, caplog):
assert len(caplog.records) == 1
msg = (
f"Sangaboard firmware version {dev_version} is below the recommended "
f"{RECOMMENDED_VERSION}."
f"{RECOMMENDED_VERSION}. Visit {WIKI_URL} for instructions on updating."
)
assert caplog.records[0].message == msg