node-tradfri-client
node-tradfri-client copied to clipboard
Investigate if all device objects should be linked to the client instance by default
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.
I'll have to look into that.
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.
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.