diff --git a/src/openflexure_microscope_server/ui.py b/src/openflexure_microscope_server/ui.py index 0f3720dd..4347fbbd 100644 --- a/src/openflexure_microscope_server/ui.py +++ b/src/openflexure_microscope_server/ui.py @@ -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 diff --git a/webapp/src/components/labThingsComponents/inputFromSchema.vue b/webapp/src/components/labThingsComponents/inputFromSchema.vue index 70a80026..0c53c8ba 100644 --- a/webapp/src/components/labThingsComponents/inputFromSchema.vue +++ b/webapp/src/components/labThingsComponents/inputFromSchema.vue @@ -1,6 +1,21 @@