Icon pickers now support manual entries

icons
habpanel
Tags: #<Tag:0x00007f1e5643b928> #<Tag:0x00007f1e5643b6f8>
(Yannick Schaus) #1

I’ve made a minor but (potentially) needed change in the HABPanel icon handling, in order to enable more flexibility for icon selection until additional iconsets can be somehow added to the list.

All icon pickers thoughout the application, including those in standard and custom widgets, now feature two additional options: Custom icon and Custom URL:

Selecting those “special iconsets” will display text inputs instead of the standard icon picker dropdown:

  • Custom icon allows to select an icon registered in openHAB (including icons added in conf/icons/classic). Those are “state-aware”: for example, stars will display
    stars-on.svg resp. stars-off.svg when the item’s state is ‘ON’ resp. ‘OFF’ if they exist.
    (Check out @ThomDietrich’s repository for the icons used in this example)
    Only the SVG format is supported for custom icons.
    Also, custom icons can’t be “colorized” like the built-in icons.

  • Custom URL allows an arbitrary image to act as an icon. All formats supported by the browser are allowed, including SVG, PNG, JPEG, GIF etc.

Note: this shouldn’t break the existing API so your current icons will still work!

12 Likes

Template widget - tutorial & examples - make your own widget!
(Mihir Patil) #2

How do I get the icon picker to show up?

0 Likes

(Kuba Wolanin) #3

You need to update your openHAB to latest snapshot version, it should show up.

1 Like

(Mihir Patil) #4

How can I do dynamic icons with this?

0 Likes

(Daniel Humphreys) #5

ive added my icons to icons/classic and type the file name in but i just get a broken image can anyone help? ive checked and my files follow the rules.

0 Likes

(Yannick Schaus) #6

Chances are, it’s case sensitive, check your casing and if doesn’t work check the Network tab (or the Console) in the browser’s developer tools and look for a 404 error.

0 Likes

(Daniel Humphreys) #7

ive checked the case sensitivity and they are in lower case. ill have a look for 404 errors

thank you

0 Likes

(Daniel Humphreys) #8

i get a server 500 error any ideas ?

0 Likes

(Guido Strotmann) #9

Please check that you have set read permissions for everyone for your own icons.

0 Likes