Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Basic UI: Active switch item with mapping isn't highlighted any longer #3472

Closed
msfunty opened this issue May 17, 2017 · 8 comments
Closed

Comments

@msfunty
Copy link

msfunty commented May 17, 2017

I'm using openhab2 and my configuration is based on sitemaps.

All switch items are being displayed but since a week (or so) the chosen item is not highlighted any longer.
When you click it button will be highlighted, but when you leave the page and go back it is not highlighted anymore.

@lolodomo
Copy link
Contributor

Please provide a portion of your items and sitemap showing this issue.
It could be linked to the binding behind your channel that does not handle your command ?

@msfunty msfunty changed the title Basic UI: Active switch item isn't highlighted any longer Basic UI: Active switch item with mapping isn't highlighted any longer May 17, 2017
@msfunty
Copy link
Author

msfunty commented May 17, 2017

I changed the title.
Normal switch items work, but when mapping is involved it doesn't.

Sitemap (partly):
Switch item=Ventilation_Fan_Level label="Fan" mappings=[1="A", 2="1", 3="2", 4="3"]

Items (partly):
Number Ventilation_Fan_Level "Fan [%d]" {comfoair="fan_level"}

That problem also exists for items binded to KNX and others. So I assume it is not related to a certain binding.

@lolodomo
Copy link
Contributor

Maybe a consequence of my PR #3368. I will check.

@lolodomo
Copy link
Contributor

Unfortunately, I can confirm the issue using the scene widget from the demo sitemap.

@lolodomo
Copy link
Contributor

I think it has no link with my change but might be again a consequence of PR #3332.
@triller-telekom : could you please take a look ? You can reproduce the issue with the demo sitemap using the 2 "scene" widgets (selection and switch/mappings).
Probably the issue is the conversion of number to ON/OFF ?

@lolodomo
Copy link
Contributor

I think the fix is to not try converting to OnOffType when the widget is a switch with mappings.

@triller-telekom
Copy link
Contributor

triller-telekom commented May 19, 2017

Indeed you are right. In this case the Sitemap Switch points to a NumberItem which usually is not on/off but multiple settings. I created a PR to fix this.

But I am curious on how many more bugs we find due to my conversion method in PR #3332... Initially I fixed a bug with it but it looks like a lot of functionality relied on that bug/behavior ;-)

@lolodomo
Copy link
Contributor

Your PR was a clear improvement but it would have needed more testing ;)

sjsf pushed a commit that referenced this issue May 22, 2017
* BasicUI: Treat Switch on NumberItem not as ON/OFF Switch
* Only convert state of plain switches without mappings
* Fix exception in test due to new check in implementation
* Test for state conversion on switch with mapping

Fixes #3472
Signed-off-by: Stefan Triller <stefan.triller@telekom.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants