Python asyncio package to connect to MySensors gateways.
Project description
aiomysensors
Python asyncio package to connect to MySensors gateways.
Installation
Install this via pip (or your favourite package manager):
pip install aiomysensors
Example
"""Show a minimal example using aiomysensors."""
import asyncio
from aiomysensors import AIOMySensorsError, Gateway, SerialTransport
async def run_gateway() -> None:
"""Run a serial gateway."""
port = "/dev/ttyACM0"
baud = 115200
transport = SerialTransport(port, baud)
try:
async with Gateway(transport) as gateway:
async for message in gateway.listen():
print("Message received:", message)
except AIOMySensorsError as err:
print("Error:", err)
if __name__ == "__main__":
try:
asyncio.run(run_gateway())
except KeyboardInterrupt:
pass
Command Line Interface
There's a CLI for testing purposes.
aiomysensors --debug serial-gateway -p /dev/ttyACM0
Credits
This package was created with Cookiecutter and the browniebroke/cookiecutter-pypackage project template.
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
aiomysensors-0.3.17.tar.gz
(27.7 kB
view details)
Built Distribution
File details
Details for the file aiomysensors-0.3.17.tar.gz
.
File metadata
- Download URL: aiomysensors-0.3.17.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19cdb9e80962c0c8f79f7bc2481f6210719422ea1fc1c3920cb8aa49e3879187 |
|
MD5 | dad241d56c57f7af0630d3386f538d03 |
|
BLAKE2b-256 | d4d09b65a1db47836bfb2ab2d4880fdddf70f96c0a9f2e0ae24e4965eb15313f |
Provenance
File details
Details for the file aiomysensors-0.3.17-py3-none-any.whl
.
File metadata
- Download URL: aiomysensors-0.3.17-py3-none-any.whl
- Upload date:
- Size: 40.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6726d3721ffacfbcbe2df5c2792fcc798302a348798590fced66b7c6e06f6099 |
|
MD5 | 4d11a52e3ec4eb189af028d2daf24d7b |
|
BLAKE2b-256 | a9ea0bc2d552ba632a7e450e2fd1eb2588bca793ccf114e754f6e4cd34b65bab |