连接到GogoGate2和iSmartGate集线器的库
项目描述
Python gogogate2-api

控制GogoGate2和iSmartGate设备的Python库
安装
pip install gogogate2-api
命令中的使用
$ gogogate2 --help
Usage: gogogate2 [OPTIONS] COMMAND [ARGS]...
Interact with the device API.
Options:
--host TEXT [required]
--username TEXT [required]
--password TEXT Omit for interactive prompt. Use '-' to read from stdin.
--version Show the version and exit.
--help Show this message and exit.
Commands:
close Close the door.
info Get info from device.
open Open the door.
$ ismartgate --help
Usage: ismartgate [OPTIONS] COMMAND [ARGS]...
Interact with the device API.
Options:
--host TEXT [required]
--username TEXT [required]
--password TEXT Omit for interactive prompt. Use '-' to read from stdin.
--version Show the version and exit.
--help Show this message and exit.
Commands:
close Close the door.
info Get info from device.
open Open the door.
代码中的使用
from gogogate2_api import GogoGate2Api, ISmartGateApi
# GogoGate2 API
gogogate2_api = GogoGate2Api("10.10.0.23", "admin", "password")
# Get info about device and all doors.
await gogogate2_api.async_info()
# Open/close door.
await gogogate2_api.async_open_door(1)
await gogogate2_api.async_close_door(1)
# iSmartGate API
ismartgate_api = ISmartGateApi("10.10.0.24", "admin", "password")
# Get info about device and all doors.
await ismartgate_api.async_info()
# Open/close door.
await ismartgate_api.async_open_door(1)
await ismartgate_api.async_close_door(1)
构建
项目构建、测试和代码检查全部通过一个脚本完成。您只需要几个依赖项。
依赖项
- 路径中的python3。
- python3的
venv
模块。
构建脚本将设置venv、依赖项、测试和代码检查并将项目打包。
./scripts/build.sh
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪一个,请了解有关安装包的更多信息。
源分发
gogogate2_api-3.0.1.tar.gz (12.5 kB 查看哈希值)
构建分发
gogogate2_api-3.0.1-py3-none-any.whl (12.7 kB 查看哈希值)
关闭
gogogate2_api-3.0.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | f8622ca469cff3ab13a66bf1950128f436817c097e7a71a706787095b56707f3 |
|
MD5 | 1e15c18e9c4bfc1cfb387b89c1fe2cc6 |
|
BLAKE2b-256 | d778be3d9db7ce5ff0de6e1f3db8a0a1e7ffc48873436a86cffa435f959252a9 |
关闭
gogogate2_api-3.0.1-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 479ef3c5040a03e749deb661be67209d3949a8379ffb8424c167f5b0957b1721 |
|
MD5 | e79112a361ceb7c9c17029b003b7b940 |
|
BLAKE2b-256 | 22c01d3beb419b1a168a2fa8d85b87e649d089e798341440a909ee953b5140d2 |