Skip to content

REST API PUT times out #122

@atirage

Description

@atirage

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions