Closed lolodomo closed 1 year ago
Here is a capture of network traffic when opening the equipment tab containing my items.
We can see that there is no particular handling of icon values, they are passed to the OH icon server directly without considering the icon source and without considering the icon set:
It is apparently just not yet implemented at this place.
In the admin pages (list of items, item page or edit item page), the problem is different, it is the icon set that it is not handled at all. Here is when the icon is "oh:classic:pressure":
The icon source ("oh") is correctly removed but the icon set is not extracted and not provided to the request through the iconset parameter.
Regarding the item page when the icon source is material or iconify, I don't see any call to the OH icon server so I guess that it is properly detected a non OH icon source but the icon is not displayed. Probably something not properly handled in that specific page.
This is a little my fault, I was convinced that icon source was already fully supported by Main UI, I now understand it is probably only partially supported, meaning only at certain places. I hope it can be easily enhanced to get a full support.
I can also mention the problems are the same in the property tab as in the equipment tab. Not tested the Location tab but I guess it should be the same.
The problem
The syntax for item icon has been extended in core framework with PR openhab/openhab-core#3539.
The icon value can now contain until 3 segments separated by a colon (":"). First segment is the icon source. Example: oh, if, iconify, material, f7, ... Second segment is the icon set. Example: classic Third segment is the icon name (and can contain hyphen). Example: temperature In case only two segments are provided, the first segment is the icon source and the second the icon name. "classic" icon set is assumed. In case only one segment is provided, the icon source is assumed to be the openHAB server and its classic icon set and the value is then the icon name.
MainUI already supports this new syntax in certain pages but not all.
Here are examples of item icon values that should work everywhere in MainUI:
Only "temperature" icon is displayed in the equipment tab of MainUI (opening the "Web services" pop-up). The others should be displayed too.![image](https://user-images.githubusercontent.com/10186704/231412107-2a12c57f-9a14-48f9-aed7-dd59b1dfa8e6.png)
Icon "oh:classic:pressure" is shown nowhere, neither in the items page, nor the item page, nor the edit item page and nor the model page.
Icon "material:favorite" is not shown in the item page (but OK in the items page, the edit item page and the model page):![image](https://user-images.githubusercontent.com/10186704/231532361-7dcfe2bf-b646-4846-8579-d4ef2534a2e4.png)
Icons "iconify:wi:day-sunny-overcast" and "if:wi:day-thunderstorm" are not shown in the item page (but OK in the items page, the edit item page and the model page):![image](https://user-images.githubusercontent.com/10186704/231532809-38e0319c-fed0-4c1f-8eae-3d4374c3fd6d.png)
Expected behavior
MainUI should support the new icon syntax with 3 possible segments in all places. It includes:
Steps to reproduce
Here are example items I used for my tests:
Browser console
Browser network traffic