Open robmarkcole opened 6 years ago
Currently the method to update the state of a sensor (get_sensor) is inefficient since each sensor makes a request:
https://github.com/studioimaginaire/phue/blob/00c85d8ce9790d7cc794d277af2d153c92c6009c/phue.py#L951
This is unnecessary since get_sensor_objects can request the data for all sensors in a single request:
https://github.com/studioimaginaire/phue/blob/00c85d8ce9790d7cc794d277af2d153c92c6009c/phue.py#L801
get_sensor could be updated to minimise the number of requests, as users with many sensors may run into request limits (I believe 30 requests per second is the maxiumum).
OK this appears to be addressed in issue https://github.com/studioimaginaire/phue/issues/109
Would you be interested to make a PR ?
Currently the method to update the state of a sensor (get_sensor) is inefficient since each sensor makes a request:
https://github.com/studioimaginaire/phue/blob/00c85d8ce9790d7cc794d277af2d153c92c6009c/phue.py#L951
This is unnecessary since get_sensor_objects can request the data for all sensors in a single request:
https://github.com/studioimaginaire/phue/blob/00c85d8ce9790d7cc794d277af2d153c92c6009c/phue.py#L801
get_sensor could be updated to minimise the number of requests, as users with many sensors may run into request limits (I believe 30 requests per second is the maxiumum).