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...
The new
thing_slotintroduced in #194 should be ideal for plugins: by declaring a mapping slot with the right type, aThingcan access all instances ofPluginThingon 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
Thingnames 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 thevalue_type) of properties to depend on the hostThing. 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...