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.9.tar.gz
(27.7 kB
view details)
Built Distribution
File details
Details for the file aiomysensors-0.3.9.tar.gz
.
File metadata
- Download URL: aiomysensors-0.3.9.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d124fc2064463fd6e71502967a704cbb4df2668f396abc97f35aeef6fc6f2ba4 |
|
MD5 | 6f4e1a9fe37dc0d9a347ff71311ed059 |
|
BLAKE2b-256 | 5ccec94904f52db9866f482d2cc8a0a76543024a7a85b164697d029b6067efc0 |
Provenance
File details
Details for the file aiomysensors-0.3.9-py3-none-any.whl
.
File metadata
- Download URL: aiomysensors-0.3.9-py3-none-any.whl
- Upload date:
- Size: 40.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d352cb3c4506653ce82d64f713a1347284165823753edc27bc17362ccc06c2ad |
|
MD5 | ef86e40d34993c66d5af62fc17e107e6 |
|
BLAKE2b-256 | ca964586c1dace887774f2595a5ad2fae8a4e608884f67c9dbd4850570ca1dbe |