openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
914 stars 422 forks source link

Define a default icon source #4042

Open mueller-ma opened 8 months ago

mueller-ma commented 8 months ago

It's possible to use other icon sets than the default one in (but not only) sitemaps, e.g. f7:light. It can be a bit cumbersome to define the icon source and icon set prefix for every icon when someone wants to use the same style for all icons. Thus I suggest to implement a new setting called "Default icon source" which will prefix all icons without an explicit source, e.g. setting is f7 than the icon light becomes f7:light. This transformation can be done by the server, so no UI needs to be adapted (BasicUI, Android and iOS apps support this syntax). Icons from the classic set can be referenced by oh:classic:light.

lolodomo commented 8 months ago

You imagine a treatment on server side that updates a sitemap after loading it to inject the default icon source ?

mueller-ma commented 8 months ago

Yes, something on the server.

lolodomo commented 8 months ago

The default icon source would be a global server setting, not a setting for each sitemap ? Depending on sitemap, a user could prefer different default icon source. I would rather imagine a new "property" of each sitemap.

mueller-ma commented 8 months ago

I usually define icons for all items, so that they are the same on all sitemaps and the settings in Main UI. Therefore I personally need the icon to be changed in the compoment that parses the items.

lolodomo commented 8 months ago

So rather a global server setting considered by server when responding to REST calls. Main UI should have a way to get the value of this setting I guess.