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
Release Process
To tag and release the latest code:
# Write release notes
vim HISTORY.rst
git add HISTORY.rst
git commit -m "Release notes for vx.y.z"
# Bump
bump2version [patch,minor,major]
# Assuming no errors ...
git push --tags
Go to this repository in Github, make a new release using the UI.
The Github Action should then take care of publishing the release on Pypi.
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.6 (2024-09-22)
Correct syntax of release notes
0.3.5 (2024-09-22)
Correct silly typo in release process
0.3.4 (2024-09-22)
Add more supported commands
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
File details
Details for the file suta_ble_bed-0.3.6.tar.gz
.
File metadata
- Download URL: suta_ble_bed-0.3.6.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9703259c9f7869ab9f3d716da99817923ac72acdf5c5397b32f937788746d701 |
|
MD5 | a884aa102aa481084e192e3a43a20183 |
|
BLAKE2b-256 | 202fa0f102b7592acbe0c175bca3e6de36ed480ecbcdae59bdc5a3de82c8f33d |
File details
Details for the file suta_ble_bed-0.3.6-py2.py3-none-any.whl
.
File metadata
- Download URL: suta_ble_bed-0.3.6-py2.py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a611a615ceb2b90b295ef3580ce29f47eb8addd97868740499caeeca7aad8f0 |
|
MD5 | 7984dc26d07727d729eafae3e66654e3 |
|
BLAKE2b-256 | 15db4c650fa711053a8835fe85aec3b58b244018499f568d2a2ba5ef9ecb6048 |