Python API to interact with the Anova Nano.
Project description
PyAnova-Nano
Control the Anova Nano via BLE.
This is a rough translation of 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.
Examples
Automatic discovery
The device should be found automatically based on the service uuid it provides.
Context manager: auto connect and disconnect
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
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.
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.
Project details
Release history Release notifications | RSS feed
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 pyanova_nano-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93da8851614d5266a09ea859789ab76faea2e6f6da50d972671b972d7b42e38e |
|
MD5 | d6434d90c569b6958f4d10cd5e5f24d5 |
|
BLAKE2b-256 | b9d52aa648034e369f71381e55af1e5a39b54d36fed38c8948accd2736207920 |