openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
224 stars 242 forks source link

[BaiscUI] Icon update ignoring the OH iconset #1790

Closed lolodomo closed 1 year ago

lolodomo commented 1 year ago

Which UI are you reporting an issue for?

The problem

When an update event is received by Basic UI, the icon update ignores the iconset, meaning classic iconset is always considered. If your icon is not in the classic iconset, it can lead to either the icon disappearing or a wrong icon displayed because there is an icon with the same name in the classic iconset.

Expected behavior

Consider the iconset when updating the icon in the current page.

Additional information

The icon is properly retrieved when you open a new page. The problem is only when an update is triggered in the current page.

lolodomo commented 1 year ago

What I have done in PR #1706 did not enhance the live update of the OH icon (when iconset is not classic).

lolodomo commented 1 year ago

Using these additional icons in a separate iconset:

$ ls conf/icons/mdi
lightbulb_cfl_spiral.svg  lightbulb.svg

Using the following sitemap:


sitemap test4 label="Tests"
{
        Frame label="Using different iconsets" {
                Text item=TestColor label="Icon lightbuld (classic)" icon="lightbulb"
                Text item=TestColor label="Icon lightbuld (mdi)" icon="mdi:lightbulb"
                Text item=TestColor label="Icon lightbulb_cfl_spiral (mdi)" icon="mdi:lightbulb_cfl_spiral"
        }
}

Here is the result when opening the sitemap: image

And after selecting a color, the second icon is wrong and the third icon disappear: image