Classic UI: custom icons depending on state are not working #1034
Comments
Could you give an example using the official demo setup, so that it is easy for others to reproduce? |
I have not used the demo setup since ages. Not obvious. It will probably require a change in items/sitemap except if the demo setup already use custom icons. Note that the problem is identical in the Android application. It seems that you already identified this issue in the Android app: openhab/openhab-android#145 |
Is it correct that this is solved by #1115? |
@clinique: I can confirm that your PR fixed my issue with dynamic icons (tested in distro 172). But to work well, I absolutely need to define a file "wifi.png". If this file is missing, the icon is not displayed even when the value is set to a value corresponding to a PNG file present in the directory conf/icons/classic. |
Yes, this is expected. Would be great if you could do a PR for updating the documentation! |
@kaikreuzer : PR created openhab/openhab-distro#152 |
@kaikreuzer @clinique what is the folder for custom icons for Basic UI ? |
No, con/icons/classic. The classic does not refer to the ui, but to the icon set (https://www.eclipse.org/smarthome/documentation/features/ui/iconset/classic/readme.html). |
@kaikreuzer @clinique in this case, unfortunately it does not work in Basic UI while it is now working in Classic UI (distro 172). |
@lolodomo : I think that Basic UI needs SVG format icons. Have you tested that ? |
No I only tested with PNG files. |
FTR: openhab/openhab-distro#152 (comment)
This is technical simply not possible. You cannot meaningfully convert bitmaps into vector graphics. |
Ok, after switching from SVG to PNG in Basic UI setup, it works almost as expected. Only icon refresh when page is opened is not working. |
Signed-off-by: Gaël L'hopital <glhopital@gmail.com>
I defined an item of type Number:
In the folder "conf/icons/classic", I put 5 files: wifi-1.png, wifi-2.png, wifi-3.png, wifi-4.png and wifi.png.
When my item is not yet set, the displayed icon is wifi.png, that's ok.
Then when my item value is set to 3 (for example), the expected result would be that classic UI displayed the icon wifi-3.png. In fact, it just displayed the icon wifi.png.
It seems that classic UI does not take into account the current state of the item to select the icon.
I tried to free my browser web cache to check if the icon is updated. Nothing.
I already tried to change my item like that but it changed nothing:
It is a bug only in OH 2.0, the same item is correctly displayed with the correct icon in OH 1.8.1.
The text was updated successfully, but these errors were encountered: