The fixes I made earlier just allow it to be added again to homeassistant, but they won’t fix any of the underlying problems of the lib / bluetooth polling in general.
If someone is interested in fixing the lib, just take a look at the issues in that repository to get an idea, but a couple of ideas how to improve it:
Allow skipping finding the “endpoints” as these are always the same for the specific device type (bedside lamps use different communication handles compared to candelas).
Skip unnecessary pairing process (if the device is already paired).
If I recall correctly the current state of that project, these two changes would drop the number of (btle) requests significantly which can be helpful.
I reinstalled it this morning. It worked fine for about one hour. I played a lot with the brightness level, turning it on and off.
I left my Candela for about 30 minutes and then the component became unavailable.
The log is full of error messages:
Logger: homeassistant.components.light
Source: helpers/entity_platform.py:540
Integration: Lumière (documentation, issues)
First occurred: 12:00:36 (28 occurrences)
Last logged: 12:14:52
Updating yeelight_bt light took longer than the scheduled update interval 0:00:30
I have the latest hass.io version, and unfortunately when the component becomes unavailable it generates a very high CPU load. At least, it’s great if it works for you.
For some reason calling the update gets stuck, maybe the device is not responding for the requests or maybe there’s something else wrong. I think the custom component should be modified to timeout properly if it receives no response from the device, and not to launch new update tries if the existing hasn’t yet timeouted. That’s not a proper solution, but would at least fix those blockings.
No, I took https://github.com/rytilahti/python-yeelightbt/ and just put the files in custom_components and add the appropriate code in the config yaml. These two steps were enough for me. I think you don’t even need to do anything on the host system.
Sounds great! Feel free to open a PR to change the default interval, if you want. Maybe it makes sense then to prepare a new release (which would allow also marking it as a custom HACS repository).