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.10.tar.gz
(27.7 kB
view details)
Built Distribution
File details
Details for the file aiomysensors-0.3.10.tar.gz
.
File metadata
- Download URL: aiomysensors-0.3.10.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fed1d3761e865061d50e24629d8d9fee1352869614b484f8d0b8b3c98f79afb |
|
MD5 | 3dac93682e591fa87270234f530e5cd0 |
|
BLAKE2b-256 | b157fcdd158a0191a2ff7afc8fd9e38f60a3bba57449fc57beadb9cf8e46f95c |
Provenance
File details
Details for the file aiomysensors-0.3.10-py3-none-any.whl
.
File metadata
- Download URL: aiomysensors-0.3.10-py3-none-any.whl
- Upload date:
- Size: 40.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c46f2c13d2b010f0c1560afa3d60944ec732c1e95b7a709b431ecc96f246692 |
|
MD5 | 36c22d0b140ba28e7c32c49b61089ee2 |
|
BLAKE2b-256 | b9ec3143dc505552faa427d340427293c6fb37274e346256558a7c179332f07a |