Handle BLE communications for a SUTA bed frame such as the i500 or i800.
Project description
SUTA BLE Bed
BLE handling code for bed frames which use the SUTA app, such as the such as the i500 or i800 (and others)
Supports control of the bed but not access to the current state. Expected to be used as a module to build your own integration with some control system, but ships with a rough CLI to play with directly.
Does device discovery by name because (as far as I could tell) the bed does not support discovery by the typical manufacturer UUID.
Notionally, this should be fine unless your neighbor is actively trying to intercept your bed control.
Free software: MIT license
Documentation: https://suta-ble-bed.readthedocs.io.
Features
TODO
Usage
async with SutaBleBedController() as controller:
async for bed in controller.devices():
await bed.raise_feet()
break
Note that the async for will return a result each time the advertising data changes, which includes any time the signal strength changes.
or
python -m suta_ble_bed --MAC=AA:BB:CC:DD:EE:FF head-down
Credits
This module would not have been possible without the research done by stevendodd on Github: https://github.com/stevendodd/sleepmotion-ble/blob/main/pi-zero/sleepmotion-ble.py
Inspired by: https://github.com/sopelj/python-ember-mug/blob/main/ember_mug/mug.py
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.3.3 (2023-07-24)
Added release pipeline
0.3.2 (2023-04-10)
Fix disconnect callback
Correct comment on BLE characteristics
0.3.1 (2023-03-23)
Fix connection handling with Controller interface
Fix CLI in case MAC is not provided
Pass correct parameter when constructing SutaBleBed under callback
0.3.0 (2023-03-23)
Change to Controller interface
Fix copy-paste errors
Add “is_connected” helper
0.2.0 (2023-03-21)
Switch to Cookiecutter
0.1.4 (2023-03-20)
Finally correctly packaged with description
0.1.3 (2023-03-08)
Trying to get packaging correct
0.1.2 (2023-03-08)
Trying to get packaging correct
0.1.1 (2023-03-05)
Trying to get packaging correct
0.1 (2023-03-05)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for suta_ble_bed-0.3.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 918c5342f91f3da424243bd2e3c7b55fc317b0637e73709c2d642664e017df31 |
|
MD5 | f77d15a9dd9427521d6f15b35f8d5f5b |
|
BLAKE2b-256 | fa4ed8d2b0e54cdcbb59a1cd76094616ebdc041d2eada7556c2545e6b39f4d38 |