Add a way to select `Thing`s from a `thing_slot`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading the thing_slot implementation introduced in #194 and the code that generates the TD from static types. Trace how a host Thing could supply available Thing names to the property model without changing value_type. Done means the TD exposes those names as enum options and runtime validation remains limited to valid selections.
Written by the indexing model from the issue text.
Description
The new thing_slot introduced in #194 should be ideal for plugins: by declaring a mapping slot with the right type, a Thing can access all instances of PluginThing on the server.
It's common to want to choose a plugin - e.g. set the current method used for background detection or scan planning in an OFM. Currently, this can be done with a string - but it would be lovely to have the available Thing names appear as enum options, so that UI code can automatically generate a drop-down selector.
This is not possible at the moment, because the TD is generated from static types, and said static types don't know what Things are available in the server.
I propose we allow the model (but not the value_type) of properties to depend on the host Thing. Doing so means that we could declare the property as a string, but include it in the TD as an enum. We could do run-time validation of the string, but by restricting it to the correct values in the schema, we make it much easier to generate a nice UI.
This is unlikely to make it for the next release, but maybe the next one...
- Dominant language
- Python
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from labthings/labthings-fastapi
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
labthings/labthings-fastapi#405 ·
-
drop-python-version
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
labthings/labthings-fastapi#354 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
labthings/labthings-fastapi#312 · 1 comment ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 65/100
labthings/labthings-fastapi#407 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
labthings/labthings-fastapi#404 · 2 comments ·
All issues in labthings/labthings-fastapi
Similar issues
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
workflow: a tick's dispatch counts as 'only this step', and no review self-grants a round unattendedOpenworkflow
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
kristofdegrave/homeassistant-smart-charging#1505 ·
Maintainers usually reply within 1 day
-
metadata submission
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
canonical/content-cache-operator#163 · 1 comment ·
Maintainers usually reply within 1 day
-
[submission]Opensubmission
Difficulty 1/5 Under an hour Newbie friendliness 65/100
leanprover/lean-eval-submissions#1852 ·
Maintainers usually reply within 1 day