Closed mechalas closed 1 year ago
Isn't this an UI issue and should go to https://github.com/openhab/openhab-webui/?
I am pretty sure it should be working when you put hyphens around the value too. e.g. with the following syntax:
Switch mappings=["Scene 1"="BD/DVD","Scene 2"="Dish TV","Scene 3"="Roku","Scene 4"="Fire Stick"] icon="receiver" item=RXA710MainZone_Scene label="Main"
That works fine at first, but if you switch back to UI mode and then return to the code view, it strips away the quotes around the values so you are back where you started.
So it is clearly a bug in the UI (and not in core) as it needs to put quotes around those strings.
To add to this, I have found the same issue but also with certain special characters such as ">". If you put them in quotes it will validate but they are removed when you return to code later.
Using the BasicUI. I need to send a command to a device that has a space or a dash in it (e.g., Yamaha receiver expects to see "Scene 1" or "Scene 2", or "V-AUX"). I can define these mappings in the sitemap using the GUI editor just fine, and they work as expected. This results in the following code:
But, the syntax validator flags the whitespace and the dash as errors. E.g.:
Since it reports them as errors, you can't save any changes in the integrated Code editor without "fixing" them, but of course "fixing" them changes the commands to include the quotes since commands are treated as literal strings.