pyanova-nano


Namepyanova-nano JSON
Version 0.2.3 PyPI version JSON
download
home_pageNone
SummaryPython API to interact with the Anova Nano.
upload_time2024-11-11 19:38:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords anova ble bluetooth nano pyanova sous-vide
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyAnova-Nano

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)


Control the Anova Nano via BLE.

This is a rough translation of [dengelke/node-sous-vide](https://github.com/dengelke/node-sous-vide/).

### Notes:
- The code should be considered experimental at this point.
- Presumably this library is not compatible with any other Anova model!
- The PyAnova class is not compatible with [c3V6a2Vy/pyanova](https://github.com/c3V6a2Vy/pyanova).

# Installation

```shell
pip install pyanova-nano
```

# Examples

### Automatic discovery

The device should be found automatically based on the service uuid it provides.

#### Context manager: auto connect and disconnect

```python
import asyncio
from pyanova_nano import PyAnova

async def print_device_sensors():
    async with PyAnova() as client:
        print(await client.get_sensor_values())

asyncio.run(print_device_sensors())
```

#### No context manager

```python
import asyncio

from pyanova_nano import PyAnova


async def get_timer():
    client = PyAnova()
    await client.connect()

    print(await client.get_timer())

    await client.disconnect()


asyncio.run(get_timer())
```

### Manual connection

To use a custom address, first discover all relevant devices, then use `PyAnova.connect(device=my_anova)` with 
`my_anova` being the `bleak.BLEDevice` you want to connect to.

```python
import asyncio

from bleak import BLEDevice

from pyanova_nano import PyAnova


async def print_target_temp():
    client = PyAnova()
    devices: list[BLEDevice] = await client.discover(connect=False, list_all=True)
    # Select the device to use.
    my_anova = next(iter(devices))

    print(f"Found: {my_anova.address}")

    await client.connect(device=my_anova)

    temperature = await client.get_target_temperature()
    print(temperature)
    
    await client.disconnect()


asyncio.run(print_target_temp())
```

# Subscription to status updates

The Anova Nano deos not update the client on it's own. We have to ask it for updates.
This library allows you to poll the device for updates and subscribe to be notified.

```python
import asyncio

from pyanova_nano import PyAnova


async def main():
    async with PyAnova() as client:

        def handle_update():
            print(client.last_status)

        client.set_poll_interval(4)
        client.subscribe(handle_update)
        client.start_poll()

        # We should get 3 updates in 10 seconds before stopping the polling.
        await asyncio.sleep(10)
        await client.stop_poll()


asyncio.run(main())
```

# Troubleshooting

## Cannot connect to your Anova Nano.

1. The Anova Nano can only maintain a connection to a single client. Ensure that nothing else is connected to your Anova
Nano.
2. Try turning the device off and on by holding the start/stop button.

# Disclaimer

This software may harm your device. Use it at your own risk.

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyanova-nano",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "anova, ble, bluetooth, nano, pyanova, sous-vide",
    "author": null,
    "author_email": "Mitja Muller-Jend <mitja.muller-jend+github@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/eb/b9/fed512b73e70bcbd75eeacac931647c8cec6759177035aac9caf88f9abba/pyanova_nano-0.2.3.tar.gz",
    "platform": null,
    "description": "# PyAnova-Nano\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\nControl the Anova Nano via BLE.\n\nThis is a rough translation of [dengelke/node-sous-vide](https://github.com/dengelke/node-sous-vide/).\n\n### Notes:\n- The code should be considered experimental at this point.\n- Presumably this library is not compatible with any other Anova model!\n- The PyAnova class is not compatible with [c3V6a2Vy/pyanova](https://github.com/c3V6a2Vy/pyanova).\n\n# Installation\n\n```shell\npip install pyanova-nano\n```\n\n# Examples\n\n### Automatic discovery\n\nThe device should be found automatically based on the service uuid it provides.\n\n#### Context manager: auto connect and disconnect\n\n```python\nimport asyncio\nfrom pyanova_nano import PyAnova\n\nasync def print_device_sensors():\n    async with PyAnova() as client:\n        print(await client.get_sensor_values())\n\nasyncio.run(print_device_sensors())\n```\n\n#### No context manager\n\n```python\nimport asyncio\n\nfrom pyanova_nano import PyAnova\n\n\nasync def get_timer():\n    client = PyAnova()\n    await client.connect()\n\n    print(await client.get_timer())\n\n    await client.disconnect()\n\n\nasyncio.run(get_timer())\n```\n\n### Manual connection\n\nTo use a custom address, first discover all relevant devices, then use `PyAnova.connect(device=my_anova)` with \n`my_anova` being the `bleak.BLEDevice` you want to connect to.\n\n```python\nimport asyncio\n\nfrom bleak import BLEDevice\n\nfrom pyanova_nano import PyAnova\n\n\nasync def print_target_temp():\n    client = PyAnova()\n    devices: list[BLEDevice] = await client.discover(connect=False, list_all=True)\n    # Select the device to use.\n    my_anova = next(iter(devices))\n\n    print(f\"Found: {my_anova.address}\")\n\n    await client.connect(device=my_anova)\n\n    temperature = await client.get_target_temperature()\n    print(temperature)\n    \n    await client.disconnect()\n\n\nasyncio.run(print_target_temp())\n```\n\n# Subscription to status updates\n\nThe Anova Nano deos not update the client on it's own. We have to ask it for updates.\nThis library allows you to poll the device for updates and subscribe to be notified.\n\n```python\nimport asyncio\n\nfrom pyanova_nano import PyAnova\n\n\nasync def main():\n    async with PyAnova() as client:\n\n        def handle_update():\n            print(client.last_status)\n\n        client.set_poll_interval(4)\n        client.subscribe(handle_update)\n        client.start_poll()\n\n        # We should get 3 updates in 10 seconds before stopping the polling.\n        await asyncio.sleep(10)\n        await client.stop_poll()\n\n\nasyncio.run(main())\n```\n\n# Troubleshooting\n\n## Cannot connect to your Anova Nano.\n\n1. The Anova Nano can only maintain a connection to a single client. Ensure that nothing else is connected to your Anova\nNano.\n2. Try turning the device off and on by holding the start/stop button.\n\n# Disclaimer\n\nThis software may harm your device. Use it at your own risk.\n\nTHERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \u201cAS IS\u201d WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python API to interact with the Anova Nano.",
    "version": "0.2.3",
    "project_urls": {
        "Homepage": "https://github.com/filmkorn/pyanova-nano",
        "Issues": "https://github.com/filmkorn/pyanova-nano/issues"
    },
    "split_keywords": [
        "anova",
        " ble",
        " bluetooth",
        " nano",
        " pyanova",
        " sous-vide"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5de94e5f6aff9dc47e0efd29a230928d842adfceba55016f9c5efc70e8da12c4",
                "md5": "7ae9713ecbf2aa2c85482741bed6f05a",
                "sha256": "c333ab2a8728fb6acc9a64dfe7eb0447cd6d8e15c88cb7936283a71d536b8420"
            },
            "downloads": -1,
            "filename": "pyanova_nano-0.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7ae9713ecbf2aa2c85482741bed6f05a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 20301,
            "upload_time": "2024-11-11T19:38:34",
            "upload_time_iso_8601": "2024-11-11T19:38:34.576496Z",
            "url": "https://files.pythonhosted.org/packages/5d/e9/4e5f6aff9dc47e0efd29a230928d842adfceba55016f9c5efc70e8da12c4/pyanova_nano-0.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ebb9fed512b73e70bcbd75eeacac931647c8cec6759177035aac9caf88f9abba",
                "md5": "23704a7391293d626a8b310408f16fb1",
                "sha256": "2c4fb2c19181196f1cd2b19f5a265f695d9a1d0c10ece772ae3b28df9ed07ae2"
            },
            "downloads": -1,
            "filename": "pyanova_nano-0.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "23704a7391293d626a8b310408f16fb1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 17613,
            "upload_time": "2024-11-11T19:38:35",
            "upload_time_iso_8601": "2024-11-11T19:38:35.511855Z",
            "url": "https://files.pythonhosted.org/packages/eb/b9/fed512b73e70bcbd75eeacac931647c8cec6759177035aac9caf88f9abba/pyanova_nano-0.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-11 19:38:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "filmkorn",
    "github_project": "pyanova-nano",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyanova-nano"
}
        
Elapsed time: 0.90823s