dominicusmento / CSharpTradFriLibrary

This is a .NET Standard (2.0) library to communicate with the IKEA Home (Tradfri) ZigBee-based Gateway.
GNU General Public License v3.0
37 stars 20 forks source link

CoapClient instance needed for ObserveDevice method on DeviceController #21

Closed scheelings closed 5 years ago

scheelings commented 5 years ago

Hi,

I am trying to implement the new version (1.0.0.31) of the TradfriLibrary. When I want to observe updates on a device, so I need to call the ObserveDevice method on the DeviceController: public CoapObserveRelation ObserveDevice(CoapClient cc, TradfriDevice device, Action<TradfriDevice> callback, Action<CoapClient.FailReason> error = null)

You'll notice that a reference to the CoapClient is needed, which is a private member of the TradfriController instance: private CoapClient _coapClient;

Can you update the code, so the CoapClient is public visible or change the ObserveDevice method, so the CoapClient instance is not needed anymore?

Thx, Danny

dominicusmento commented 5 years ago

This is also fixed by rewriting the observable part and CoapClient is no longer needed