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

[hue] Refresh is not working correctly (API v2) #15735

Closed
jlaur opened this issue Oct 10, 2023 · 0 comments · Fixed by #15736
Closed

[hue] Refresh is not working correctly (API v2) #15735

jlaur opened this issue Oct 10, 2023 · 0 comments · Fixed by #15736
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@jlaur
Copy link
Contributor

jlaur commented Oct 10, 2023

When linking a new item to a channel, its value is not updated in a timely manner.

Expected Behavior

The binding should request initial state upon receiving a REFRESH command.

Current Behavior

Under some circumstances the binding will skip the refresh logic.

Possible Solution

The conditions here seem wrong:

Future<?> task = updateServiceContributorsTask;
if (Objects.isNull(task) || !task.isDone()) {
cancelTask(updateServiceContributorsTask, false);
updateServiceContributorsTask = scheduler.schedule(() -> {

I believe it will skip the refresh logic when updateServiceContributorsTask is assigned and done.

Steps to Reproduce

  • Create a new Thing, for example a battery-powered sensor such as a motion sensor that will only rarely send data (on motion detection and periodically on temperature changes, etc).
  • Link an item to a channel.
  • Wait for the state to be set.

Context

While working on #15552 I observed this behavior while testing.

A work-around is to disable and reenable the bridge Thing.

Your Environment

  • Version used: 4.0.3 and 4.1-snapshot
@jlaur jlaur added the bug An unexpected problem or unintended behavior of an add-on label Oct 10, 2023
jlaur added a commit to jlaur/openhab-addons that referenced this issue Oct 10, 2023
Fixes openhab#15735

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
lolodomo pushed a commit that referenced this issue Oct 14, 2023
* Fix refresh/initial state request

Fixes #15735

* Fix channel updates when thing comes online
Fixes #15669

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Also-by: Andrew Fiddian-Green <software@whitebear.ch>
jlaur added a commit that referenced this issue Oct 15, 2023
* Fix refresh/initial state request

Fixes #15735

* Fix channel updates when thing comes online
Fixes #15669

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Also-by: Andrew Fiddian-Green <software@whitebear.ch>
querdenker2k pushed a commit to querdenker2k/openhab-addons that referenced this issue Oct 21, 2023
* Fix refresh/initial state request

Fixes openhab#15735

* Fix channel updates when thing comes online
Fixes openhab#15669

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Also-by: Andrew Fiddian-Green <software@whitebear.ch>
querdenker2k pushed a commit to querdenker2k/openhab-addons that referenced this issue Oct 29, 2023
* Fix refresh/initial state request

Fixes openhab#15735

* Fix channel updates when thing comes online
Fixes openhab#15669

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Also-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: querdenker2k <querdenker2k@gmx.de>
austvik pushed a commit to austvik/openhab-addons that referenced this issue Mar 27, 2024
* Fix refresh/initial state request

Fixes openhab#15735

* Fix channel updates when thing comes online
Fixes openhab#15669

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Also-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant