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

Fix brightness parsing #3490

Merged
merged 1 commit into from
Oct 1, 2023
Merged

Conversation

mueller-ma
Copy link
Member

While debugging issues with color items I discovered that two SSE events are sent when a slider with a color item is updated.

Item:

label: Debug Color 1
type: Color
category: oh:mdi:palette
groupNames: []
groupType: None
function: null
tags: []

Sitemap:

Slider item=D_Color iconcolor=["itemValue"]

The first event contains a state in the hsb format (10,10,10), the second events contains the brightness only (10). Parsing an integer as brightness failed and the slider was set to 0.
IMO an integer in the range 0..100 can be considered as brightness.

While debugging issues with color items I discovered that two SSE events
are sent when a slider with a color item is updated.

Item:
````
label: Debug Color 1
type: Color
category: oh:mdi:palette
groupNames: []
groupType: None
function: null
tags: []
````

Sitemap:
````
Slider item=D_Color iconcolor=["itemValue"]
````

The first event contains a state in the hsb format (`10,10,10`), the
second events contains the brightness only (`10`). Parsing an integer as
brightness failed and the slider was set to `0`.
IMO an integer in the range `0..100` can be considered as brightness.

Signed-off-by: mueller-ma <[email protected]>
@maniac103 maniac103 merged commit 48a9692 into openhab:main Oct 1, 2023
7 checks passed
@mueller-ma mueller-ma deleted the fix-color-slider branch October 1, 2023 09:33
mueller-ma added a commit to mueller-ma/openhab.android that referenced this pull request Dec 11, 2023
Similar to openhab#3490, but also for brightness in floats, e.g. `23.0`.

Signed-off-by: mueller-ma <[email protected]>
mueller-ma added a commit that referenced this pull request Dec 16, 2023
Similar to #3490, but also for brightness in floats, e.g. `23.0`.

Signed-off-by: mueller-ma <[email protected]>
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.

2 participants