Apollon77 / daikin-controller-cloud

Connect and Control Daikin Cloud devices
MIT License
99 stars 26 forks source link

return device with updateData() #69

Closed JeroenVdb closed 2 years ago

JeroenVdb commented 2 years ago

I working on a Homebridge plugin for the Daikin Cloud: https://github.com/JeroenVdb/homebridge-daikin-cloud

Apple Home/Homebridge is sometimes asking a lot of updates (room temperature, current room temperature goal, current state, etc...) in parallel. I would like to keep a short living cache in my plugin myself.

Would it be possible to return the device itself on the updateData() method? See: https://github.com/Apollon77/daikin-controller-cloud/blob/main/lib/device.js#L151-L156

If this is provided I think I can maintain the cache myself and you have no need in implementing this yourself (see https://github.com/Apollon77/daikin-controller-cloud/blame/main/README.md#L55). In my opinion this is up to the projects using the package.

Apollon77 commented 2 years ago

The library already maps the weird data structure from the cloud in something internal ... I think getdata (https://github.com/Apollon77/daikin-controller-cloud/blob/652a06d7c2f9dacb74547aaff468758e8fae39d2/lib/device.js#L120 doew what you need ... just call without any parameter

JeroenVdb commented 2 years ago

Great, thanks!