eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 783 forks source link

[sitemap] Allow a map transformation as mappings source for Switches and Selections #6174

Open jboeddeker opened 6 years ago

jboeddeker commented 6 years ago

The mappings keyword allows to add a list of key/value pairs to a Switch or a Selection.

It would be great if something reusable could be added to this. Currently every switch or selection needs its own list. I use such lists in several places, it is an ugly copying within the sitemaps.

Examples:

Reusing a map transformation would be a good thing:

Thanks

cubistico commented 5 years ago

Forgive me when I'm on the wrong track, but it isn't possible to use

Switch item=KUKodi_pvropentv "[MAP(tvchannels.map):%S]" for this?

Of course, this is for display only. Is your approach another?

jboeddeker commented 5 years ago

@cubistico, this issue is about the mappings keyword not the display transformations.

The mappings keyword defines the options which are available as switches or selection items.

image

Currently the mappings need to be hardcoded in the sitemap for each instance.

cubistico commented 5 years ago

@jboeddeker, thanks for the clarification. So then I second this improvement request.