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

Investigate if all device objects should be linked to the client instance by default #130

Open
erspearson opened this issue Mar 9, 2019 · 3 comments
Assignees

Comments

@erspearson
Copy link

link(client: OperationProvider): this;

is curiously missing from its definition file IPSOObject.d.ts

Also - any reason why the cloned objects (e.g. Groups) found in e.g. tradfri.groups[] collection are not linked back to the client they sit under? Linking is done after cloning to the emitted copies.

@AlCalzone AlCalzone self-assigned this Mar 10, 2019
@AlCalzone
Copy link
Owner

I'll have to look into that.

@erspearson
Copy link
Author

Ah, I see - link(client: OperationProvider): this; was tagged as @internal on 8 January 2018 replacing the comment 'INTERNAL USE ONLY'

So it looks like your intention for the simplified API is that it should only be used on the objects emitted by the events, not on the ones found in tradfri.devices[], tradfri.groups[] etc

As a new user, VSCode lead me into trying to use
tradfri.groups[131075].group.turnOn()
but that gives the runtime error that the object is 'not linked to a client instance' which seems surprising at the time since it came directly from the client if you see what I mean.

@AlCalzone
Copy link
Owner

As a new user, VSCode lead me into trying to use ...

This might be a valid thing to do nonetheless. I'll let you know if that is something that should be supported.

@AlCalzone AlCalzone changed the title Missing link(client) from IPSOObject.d.ts Investigate if all device objects should be linked to the client instance by default Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants