与Veralite™智能家居控制器对话的PythonAPI和命令行工具
python-veralite的Python项目详细描述
安装
[sudo] pip install python-veralite
用法
模块
您可以将模块导入为veralite。
importveraliteip='192.168.1.89'user='admin'password='password'vera_api=veralate.Veralite(ip,user,password)vera_api.update_devices()
命令行
usage: veralite [-h][--conf FILE] --ip IP -u USER -p PASSWORD {light,motion,switch} ... Command line interface to Veralite™ Smart Home Controller positional arguments: {light,motion,switch}commandhelp light light commands motion motion sensor commands switch switch commands optional arguments: -h, --help show this help message and exit --conf FILE config file (default ~/.config/veralite/config) --ip IP the ip for veralite system -u USER, --user USER username for veralite -p PASSWORD, --password PASSWORD password for veralite examples: veralite --ip 192.168.1.22 -u veraadmin -p adminpassword switch modify --id 22 --on veralite --ip 192.168.1.22 -u veraadmin -p adminpassword light list veralite --ip 192.168.1.22 -u veraadmin -p adminpassword motion modify --id 10 --arm
还可以指定配置文件以防止IP/用户/密码重复使用。
[DEFAULT]ip=192.168.1.55user=theuserpassword=mypassword