suta-ble-bed 0.3.6
Handle BLE communications for a SUTA bed frame such as the i500 or i800.
License: MIT license
Requires Python: >=3.6
Keywords: SUTA, sleepmotion, i500, i900, i200

============
SUTA BLE Bed
============


.. image:: https://img.shields.io/pypi/v/suta_ble_bed.svg
        :target: https://pypi.python.org/pypi/suta_ble_bed

.. image:: https://img.shields.io/travis/sredman/suta_ble_bed.svg
        :target: https://travis-ci.com/sredman/suta_ble_bed

.. image:: https://readthedocs.org/projects/suta-ble-bed/badge/?version=latest
        :target: https://suta-ble-bed.readthedocs.io/en/latest/?version=latest
        :alt: Documentation Status

.. image:: https://pyup.io/repos/github/sredman/suta_ble_bed/shield.svg
     :target: https://pyup.io/repos/github/sredman/suta_ble_bed/
     :alt: Updates

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
--------

.. code-block:: python

    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

.. code-block:: sh

   python -m suta_ble_bed --MAC=AA:BB:CC:DD:EE:FF head-down

Release Process
---------------

To tag and release the latest code:

.. code-block:: sh

   # 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.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


=======
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.