Merge branch 'dropdown-gui' into 'v3'

Optional options in UI property control become dropdown

See merge request openflexure/openflexure-microscope-server!477
This commit is contained in:
Joe Knapper 2026-02-18 16:43:45 +00:00
commit a6b95f0948
4 changed files with 55 additions and 7 deletions

View file

@ -1,6 +1,6 @@
"""Functionality for communicating the required user interface for a thing."""
from typing import Any
from typing import Any, Optional
from pydantic import BaseModel
@ -90,6 +90,13 @@ class PropertyControl(BaseModel):
read_back_delay: int = 1000
"""The delay in ms before reading back the property."""
options: Optional[dict[str, str | int | float | bool]] = None
"""A mapping of UI display name to value, used for creating a dropdown.
These options aren't validated here in any way. Any invalid values will be rejected
when selected.
"""
def property_control_for(
thing: lt.Thing, property_name: str, **kwargs: Any