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

Missing desired_state payload? #12

Open
scoobyshi opened this issue Jan 7, 2017 · 0 comments
Open

Missing desired_state payload? #12

scoobyshi opened this issue Jan 7, 2017 · 0 comments

Comments

@scoobyshi
Copy link
Contributor

It seems as though in the API calls made via wink-js, it is not getting the "desired_state" node in the JSON response, see this example from the debug logs:

{"object_type":"light_bulb","object_id":"133xxxx","uuid":"cdb488fc-7d56-4c61-b7fe-xxx","icon_id":"71","icon_code":"light_bulb-light_bulb",
"desired_state":{},"last_reading":{"connection":true,
.
.

When I hit the API directly (outside of Wink-JS, eg using Postman), even using the same authentication token, URL, endpoint, etc, (eg https://winkapi.quirky.com/users/me/wink_devices), I get the expected desired_state.

The consequence of this missing node is that it triggers confusion in apps downstream that might expect this node present (eg homebridge-wink), based on a query to the wink API. I'm not sure if it's something Wink changed, or in how exactly wink-js is querying the API, but it is strange. The only difference I can see between hitting the API directly and wink-js is the model, but all it does is inflate the response and isn't touching this node...

Having said all that, according to the Wink documentation, we should expect that the desired state is only set during a request and otherwise cleared: http://docs.winkapiv2.apiary.io/#reference/device/desired-state-and-last-reading/retrieve-all-devices-of-user, "When the device acknowledges that the state has been applied, the server will clear the field from desired_state."; In which case the anomaly is the direct to API queries. Any thoughts?

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

No branches or pull requests

1 participant