Skip to content

Add a way to select Things from a thing_slot #204

@rwb27

Description

@rwb27

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions