openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
214 stars 235 forks source link

For unset switch items sitemaps do not underline the unset status, unless mappings=[] is used #1555

Open dilyanpalauzov opened 1 year ago

dilyanpalauzov commented 1 year ago

Which UI are you reporting an issue for?

Basic UI and OpenHAB-Android when displaying sitemaps.

The problem

In an openhab/items/*.items file I create an item with

Switch test_switch "Let’s see"

In a sitemap I define:

Switch item=test_switch label="A1" mappings=[ON="X", OFF="Y"] Switch item=test_switch label="B2"

That is, the same item is displayed twice in the sitemap file. The value of the item was never set.

The mappings-line A1 shows clearly that the item has unset (undefined, null) value, as neither X nor Y are is selected.

The B2-line does not distinguish between OFF and UNSET value, both are presented to the user in the same way.

Expected behavior

I expect that even without mappings=[ON=, OFF=] the user can see whether a toggle has undefined state.

Your environment

OpenHAB 3.3, openHAB-Android 2.23.4-beta.

lolodomo commented 1 year ago

This was already discussed several years ago. Unfortunately, there was no solution validated to show NULL/UNDEF values.

lolodomo commented 1 year ago

https://github.com/eclipse-archived/smarthome/issues/2962 https://github.com/eclipse-archived/smarthome/issues/3742

dilyanpalauzov commented 1 year ago

The NULL/UNDEFINED state could be displayed as a toggle in the middle (neither left nor right).

Or implicit mappings=[ON="ON",OFF="OFF"] can be applied. With mapping there is distinction between set and unset value.