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

REST API PUT times out #122

Open
atirage opened this issue Dec 28, 2022 · 0 comments
Open

REST API PUT times out #122

atirage opened this issue Dec 28, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@atirage
Copy link

atirage commented Dec 28, 2022

I've noticed the following behavior while doing some changes on my miLight adapter: if I issue two consecutive REST PUT requests for the same property with the same value, the 2nd request times out, for ex. set the brightness level to 40 via REST and repeat the request.

This is the setValue code for my Property:

setValue(value) {
    return new Promise((resolve) => {
      const oldValue = this.value;
      this.setCachedValue(value);
      const hasChanged = (oldValue !== this.value);
      if (hasChanged) {
        this.device.notifyPropertyChanged(this, oldValue);
      }
      resolve(this.value);
    });
}

As far as I was able to trace the problem, it comes down to the fact that the notifyPropertyChanged is not getting called and implicitly the notifyPropertyChanged of the parent Device class is also not getting invoked so the addon manager proxy is not notified.

Any ideas on this?

@benfrancis benfrancis added the bug Something isn't working label Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants