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

Only use item state when fetching icons #3565

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Conversation

maniac103
Copy link
Contributor

sending icon requests, if available. Apparently this is wrong and we always need to use the item state for fetching icons, so roll back the respective code.

Fixes #3564

sending icon requests, if available. Apparently this is wrong and we
always need to use the item state for fetching icons, so roll back the
respective code.

Fixes openhab#3564

Signed-off-by: Danny Baumann <dannybaumann@web.de>
@maniac103
Copy link
Contributor Author

@lolodomo Does this logic look correct to use (only use item state, never use widget state as formatted by state description), especially in the light of cases like mentioned in #3445 (item state = 0.45, widget state = 45 %)?

Copy link
Member

@mueller-ma mueller-ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try it in beta.

@mueller-ma mueller-ma merged commit ccc8149 into openhab:main Jan 22, 2024
7 checks passed
@lolodomo
Copy link
Contributor

lolodomo commented Jan 23, 2024

@lolodomo Does this logic look correct

This is the current login adopted by all UIs Note that the icon servlet needs a deterministic value as current state. The widget pattern was imagined to control the format of the displayed value, but anything else, neither to control the persisted value nor the icon.
Changing and switching to the presented value for the icon, even if I can understand the logic, would probably introduced more difficulties than it solves, this issue seems to be a proof of this. Another example would be if you change your widget pattern, your dynamic icons n will no mir work.

Edit: and your example with 0.45 is just because the user forgot to set a unit to its item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug/incompatability with dynamic icon behavior for <battery> and custom icons
3 participants