Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MainUI] Icon displayed for humidity is not depending on the value #534

Closed
lolodomo opened this issue Nov 18, 2020 · 6 comments · Fixed by #540
Closed

[MainUI] Icon displayed for humidity is not depending on the value #534

lolodomo opened this issue Nov 18, 2020 · 6 comments · Fixed by #540
Labels
bug Something isn't working main ui Main UI

Comments

@lolodomo
Copy link
Contributor

The problem

The icon displayed for a humidity value is not depending on the item value.
In the following example, you can see the icon displayed for "Humidité dans le bureau".

image

Expected behavior

Display an icon depending on value, like in Basic UI:

image

Steps to reproduce

Use an item of this kind with icon "humidity":

Number HumiditeBureau "Humidité dans le bureau [%.0f %%]" <humidity> (Bureau,GHumiditeInt) [ "Measurement", "Humidity" ] {channel="..."}

And open any card that shows this item.

@lolodomo lolodomo added bug Something isn't working main ui Main UI labels Nov 18, 2020
@ghys
Copy link
Member

ghys commented Nov 18, 2020

I activated this behavior (iconUseState: true) for items of certain types:

if (item.category && ['Switch', 'Rollershutter', 'Contact', 'Dimmer', 'Group'].indexOf(item.type) >= 0) component.config.iconUseState = true

I'm not in favor of doing it for other types like Numbers or Strings by default because some could be changing frequently and that would mean too many icon requests. (Looking back even Group was a bad idea - some hold averages in their state etc.).

You can enable it on an per-item basis by modifying its listWidget (Default List Item Widget) metadata. In the future you'll also be able to specify only config options to "merge" to the default widget.

@lolodomo
Copy link
Contributor Author

lolodomo commented Nov 18, 2020

You can enable it on an per-item basis by modifying its listWidget (Default List Item Widget) metadata. In the future you'll also be able to specify only config options to "merge" to the default widget.

How complex is it just for selecting the icon !!! I just does not understand what to select and fill when I open the page you mention !!!
This was imagined for very clever users, not for someone normal like me !
Will try again tomorrow...

@lolodomo
Copy link
Contributor Author

The first is the one from my config file; the second is the one I created with the UI:
image

image

image

Now in Locations, the item appears without value and still wrong value:

image

I am clearly lost.

@lolodomo
Copy link
Contributor Author

I f I remove the metadata, the value is back but of course without the icon:

image

@lolodomo
Copy link
Contributor Author

I finally found that I have to select "Label list item" and not "list item" to get the value. But in this case, the icon is still not dependent on the value. See how it looks:
image

Here is now how is defined my default list item widget:
image

What is still missing ?

@lolodomo
Copy link
Contributor Author

lolodomo commented Nov 18, 2020

Ok, found, it is hidden in advanced configuration settings...
image

For something that everybody will want by default, sorry to say that but it is terribly complex to achieve.

But at least I know how to do it now, it just took me few hours to find.

ghys added a commit to ghys/openhab-webui that referenced this issue Nov 19, 2020
Disallow standalone widgets to be selected for list items (close openhab#536).

Allow slight alterations to the default widgets suggested by the system
without reconfiguring it completely: if the metadata value is blank,
assume the default system-suggested widget is to be used and merge the
config found in the metadata.
Closes openhab#534 (since now only the iconUseState option has to be set to
enable dynamic icons for Number items and similar).

Change the metadata namespace selection menu to only display the metadata
which is set in the metadata menu, and use an action sheet to add more.
This also paves the way for user-defined namespaces.

Move the metadata order out of the item edition card in the Model page,
into its own section.

Add metadata editor for the expire namespace
(openhab/openhab-core#1620).

Reorder the sections of the item details page in a more logical manner
(semantic classification below the tags that define it).

Signed-off-by: Yannick Schaus <github@schaus.net>
@ghys ghys closed this as completed in #540 Nov 19, 2020
ghys added a commit that referenced this issue Nov 19, 2020
Disallow standalone widgets to be selected for list items (close #536).

Allow slight alterations to the default widgets suggested by the system
without reconfiguring it completely: if the metadata value is blank,
assume the default system-suggested widget is to be used and merge the
config found in the metadata.
Closes #534 (since now only the iconUseState option has to be set to
enable dynamic icons for Number items and similar).

Change the metadata namespace selection menu to only display the metadata
which is set in the metadata menu, and use an action sheet to add more.
This also paves the way for user-defined namespaces.

Move the metadata order out of the item edition card in the Model page,
into its own section.

Add metadata editor for the expire namespace
(openhab/openhab-core#1620).

Reorder the sections of the item details page in a more logical manner
(semantic classification below the tags that define it).

Signed-off-by: Yannick Schaus <github@schaus.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants