Closed Daniel-Christian-CardinalPeak closed 4 years ago
This PR fixes a bad behavior that I'm seeing where notifications come in delayed- I'm expecting 2 notifications but I only get 1. Then next time I'm expecting 2 notifications, I get the 1 previously missing one and 1 new one (the expected 2nd new one is now delayed until next time). +1 from me
How do I install this patch on a Hass.io system?
See https://github.com/IanHarvey/bluepy/issues/354
bluepy may read multiple lines from the helper, but readline only returns the first one. Subsequent calls to poll() will delay (and possibly return None) because there is no way to know that additional lines are ready to return.
This uses a very simple loop to queue an entry every time readline returns a line. The queue lets you easily check for ready lines, as well as supporting get() with a timeout.