Python asyncio包,用于连接MySensors网关。
项目描述
aiomysensors
源代码: https://github.com/MartinHjelmare/aiomysensors
Python asyncio包,用于连接MySensors网关。
安装
使用pip(或您喜欢的包管理器)安装此软件。
pip安装aiomysensors
示例
"""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
命令行界面
有一个命令行界面用于测试目的。
aiomysensors --debug serial-gateway -p /dev/ttyACM0
致谢
此包是用Copier和browniebroke/pypackage-template项目模板创建的。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分发
aiomysensors-0.4.3.tar.gz (25.8 kB 查看哈希值)
构建分发
aiomysensors-0.4.3-py3-none-any.whl (38.7 kB 查看哈希值)
关闭
aiomysensors-0.4.3.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | f04abc66e62b4e296eab5fc9ac743a665780183816967150815a604c59034151 |
|
MD5 | fae9c0fd32b101e69b717045709fc0b2 |
|
BLAKE2b-256 | c8fc81aa3695a125d0bb4cadb9bb0da16a3296d039ecd12abc689ac9a84efe2c |
关闭
aiomysensors-0.4.3-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | f12952cfb30bb0c4da475233fcc5387c1d750653df4be0dc7f58d09a5ef7ed70 |
|
MD5 | 34551bd0e14facec6092a97b126f3bfc |
|
BLAKE2b-256 | ba57bc90fa3135c0c96b89f8b7235fae59a710dca459665bbe6d1332e1aa9326 |