pyhomebridge
1.0.0
Python库控制Homebridge服务器
在主桥上安装Homebridge-Config-Ui-X。
确保您以不安全模式运行主桥。 (可以在右上角的Web设置中进行更改)API控件仅在此模式下才允许。多数民众赞成在带有-i国旗开始主页。
Pyhomebridge的PYPI包装
pip3 install pyhomebridgePython用法:
from homebridge import HomeBridgeController
controller = HomeBridgeController ( host = "homebridge.local" , port = 80 , auth = "123-45-678" )
print ( controller . accessories )
controller . print_accessories ()
controller . accessory_exists ( "light_hallway" )
controller . get_value ( "light_hallway" )
controller . set_value ( "light_hallway" , True )在存储库中,您可以找到用于CLI执行的Python脚本。 control-homebridge.py
python3 control-homebridge.py --list
python3 control-homebridge.py --name light_hallway --off
# you will need to set url, port and code in the script
# or use the --server, --port, --auth options 当前支持的设备:
Menahishayan的本文
麻省理工学院
免费软件,地狱!