-
Notifications
You must be signed in to change notification settings - Fork 145
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
Feature Request: Expose bridge-model #132
Comments
Sure I am open to PRs. I would not want to expose all the model objects at this time, as they are meant for internal use and once they are exposed, it will lock them in the API, making the more difficult for me to change in the future. Also these are sometimes changed in the underlying Hue API on version changes, which these once exposed will not be a blessing to easily handle in their current form. I understand your use case, so can make some of these objects available if that would be useful to to if you. Could you indicate which ones you would be interested in (e.g. Lights and Scenes, etc...), then I can review the underlying objects and plan a change to support what you need. Thanks. |
Hmm, only a few will not help, but maybe we could create some sort of 'proxy' integration or a plugin or something like this. I will think about possible solutions of this and comment them here, okay? |
I have been working on standardizing the model objects to accommodate changes to the underlying API that Signify do from time to time, whilst still providing these class based objects. I am now at the point of trying to expose these in the library, but need some more information on how you would intend to use these in practice, so I can cover your use case. In your proxy, would you be happy to get a payload JSON object from the model object, say a For example the proxy would generate a JSON payload like:
Then on the client side you could would have pseudo code like: const bridgeModel = require('node-hue-api').model;
const data = {}; // Your JSON data payload from above
const group = model.create(data);
// The above group would be the model Group object |
That would exacly meet my usecase. I've working around this right now (as you can see here https://github.com/KnisterPeter/hueup). |
This is now done in alpha version All Bridge objects, I have spent a fair bit of time building up tests to cover all the objects and they are now all passing, so it should provide you with what you need. |
Awesome. Thank you |
Released in 4.0.0 |
It would be great if you could expose (or export) the
bridge-model
types from the api.I'm in need to create a proxy between the remote api and my application, because phillips does not set correct CORS headers.
When executing the
node-hue-api
on my proxy and return the result I'm ending up with the raw data objects. It would be awesome to construct the bridge models from the raw data again in my client.And just to ask: Are you open to pull requests?
The text was updated successfully, but these errors were encountered: