openhab-android: Dynamic icons do not work for `Switch`

I have openHAB-Android 2.20.13-beta and in a sitemap Switch item=r label="R" icon="x.svg".

In /etc/openhab/icons/classics I have the files x.svg - x.svg, x-off.svg - x-off.svg, and x-on.svg - x-on.svg.

The basicui displays the icons correctly, it shows either x-on.svg or x-off.svg, depending on the state of the toggle.

OpenHAB-Android displays only x.svg.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (22 by maintainers)

Most upvoted comments

Is the request … for sitemap elements without icon=“”?

No, those will yield an empty image without HTTP request. See here … constructing the URL you’re seeing happens right below that part. So the options are

  • omit icon completely -> no HTTP request
  • icon="x" -> GET request for /icon/x.svg?format=... (may also be .png, depending on settings)
  • icon="" -> the GET request you’re seeing

We may want to fix the latter case and treat an empty string the same way as if icon was omitted.