Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

[error handling] device id might change #42

Open
sanjaiganesh opened this issue Aug 12, 2016 · 2 comments
Open

[error handling] device id might change #42

sanjaiganesh opened this issue Aug 12, 2016 · 2 comments

Comments

@sanjaiganesh
Copy link
Contributor

Clients could be caching device ids. But Wink can re-purpose/change device ids.!!! could be the case with others too. We need to have device objects to have a unique id. And We need to have an error handling flow, where translator conveys this to the caller (not sure what error gets returned from wink in such cases) and caller will go back to onboarding to get latest devieid. (or whatever mechanism we chose)

http://docs.wink.apiary.io/#reference/a-restful-service

Identifiers

All objects in the Wink API can be identified by [object_type]_id; the value of the [object_type]should be used to discern which kind of object you are dealing with.
The identifier is a string and not globally unique, currently. That is there can be a 'light_bulb_id':'abc' and a 'thermostat_id':'abc'
It is possible for the API to re-assign identifiers to resources to rebalance keys; in this case, your resource will still exist but it (and all references to it) will be updated to the new identifier. Your application should be able to handle this case.

@jasongin
Copy link
Contributor

Hue and Vera APIs also present a similar challenge in what I'd call "unstable" device IDs. Usually there is some way to reliably identify a device (such as the device's mac address), but that is not the primary identifier used by the API.

@sanjaiganesh
Copy link
Contributor Author

Wink assigns an UUID for each device. Hope others providers (Hue etc..) too. provide something similar.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants