studioimaginaire / phue

A Python library for the Philips Hue system
Other
1.52k stars 267 forks source link

the code should use get_light() + get_sensor() even with OO access #109

Open fingon opened 7 years ago

fingon commented 7 years ago

Currently, if you use e.g.

get_{sensor,light}_objects

and then iterate through them, and do stuff, it is orders of magnitude slower due to built-in rate limiting (and number of HTTP requests) than if you just do once

get_{light,sensor}

and look at the full JSON dump (that has been around years, since bridge sw ver 1.3).

For example, in my case, I had to do following changes to get reasonable performance with 'few' lights/motion sensors/tap (and more coming up):

https://github.com/fingon/kodin-henki/commit/d30a518f191b1839af516ce462408958687025dd

robmarkcole commented 6 years ago

+1 this should be reviewed