lucapinello / pyacaia

Python module to interact with Acaia scales via Bluetooth (BLE)
GNU Affero General Public License v3.0
48 stars 15 forks source link

Add support for Pyxis #5

Closed danbodoh closed 3 years ago

danbodoh commented 3 years ago

This PR adds support for the Pyxis scale, which has different UUIDs and splits the notification UUID from the command UUID. Pyxis support was only added for Bluepy. Perhaps the most potentially controversial commit in this PR is commit 9f5c6e1, in which the heartbeat mechanism is changed. Bluepy requires that waitForNotifications() be called in order to get the weight notifications in real time. Since the heartbeat occurs in its own thread, if the application calls waitForNotifications(), there is collisions in some of the code that is not reentrant. So heartbeat is changed so that waitForNotifications() replaces the Timer. Unfortunately, existing applications that call waitForNotificaitons() directly will break, so a note has been added to README.md.

Further PRs will add support for some of the non-weight functions and notifications.