pyanova-nano


Namepyanova-nano JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryPython API to interact with the Anova Nano.
upload_time2024-01-21 22:58:58
maintainer
docs_urlNone
author
requires_python>=3.8
license
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).

# 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_unit():
    client = PyAnova()
    await client.connect()

    print(await client.get_timer())

    await client.disconnect()


asyncio.run(get_unit())
```

### 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())
```

# 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": "",
    "name": "pyanova-nano",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "anova,ble,bluetooth,nano,pyanova,sous-vide",
    "author": "",
    "author_email": "Mitja Muller-Jend <mitja.muller-jend+github@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/3d/31/88052faf47e7c2e04e2e725bb3297385d4d4892b50569cd3aabc2b92ff2f/pyanova_nano-0.1.0.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# 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_unit():\n    client = PyAnova()\n    await client.connect()\n\n    print(await client.get_timer())\n\n    await client.disconnect()\n\n\nasyncio.run(get_unit())\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# 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": "",
    "summary": "Python API to interact with the Anova Nano.",
    "version": "0.1.0",
    "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": "b9d52aa648034e369f71381e55af1e5a39b54d36fed38c8948accd2736207920",
                "md5": "d6434d90c569b6958f4d10cd5e5f24d5",
                "sha256": "93da8851614d5266a09ea859789ab76faea2e6f6da50d972671b972d7b42e38e"
            },
            "downloads": -1,
            "filename": "pyanova_nano-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d6434d90c569b6958f4d10cd5e5f24d5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 18217,
            "upload_time": "2024-01-21T22:58:56",
            "upload_time_iso_8601": "2024-01-21T22:58:56.286393Z",
            "url": "https://files.pythonhosted.org/packages/b9/d5/2aa648034e369f71381e55af1e5a39b54d36fed38c8948accd2736207920/pyanova_nano-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d3188052faf47e7c2e04e2e725bb3297385d4d4892b50569cd3aabc2b92ff2f",
                "md5": "570d680c2932010896dd5d540b6d8f19",
                "sha256": "cd68795ef63bbad123f4336802ae49bbc165cc48a71113da202e7a4d38b66a8e"
            },
            "downloads": -1,
            "filename": "pyanova_nano-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "570d680c2932010896dd5d540b6d8f19",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14549,
            "upload_time": "2024-01-21T22:58:58",
            "upload_time_iso_8601": "2024-01-21T22:58:58.155672Z",
            "url": "https://files.pythonhosted.org/packages/3d/31/88052faf47e7c2e04e2e725bb3297385d4d4892b50569cd3aabc2b92ff2f/pyanova_nano-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-21 22:58:58",
    "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.17252s