BlueIris的异步PythonAPI
pyblueiris的Python项目详细描述
自述文件
蓝色iris python库
Blue Iris JSON API的异步Python库。
概述
有关更深入的文档,请访问the documentation。
创建blueiris对象需要为它提供一个异步web会话。
importpyblueirisfromaiohttpimportClientSessionPROTOCOL='http'HOST=192.168.1.5USER='pyserv'PASS='secret-password'defmain():asyncwithClientSession(raise_for_status=True)assess:blue=pyblueiris.BlueIris(sess,USER,PASS,PROTOCOL,HOST)if__name__=='__main__':main()
从那里你可以简单地调用你想要它执行的命令。有一个命令update_all_information()
,它将调用所有数据收集命令来填写有关服务器的信息。
defmain():asyncwithClientSession(raise_for_status=True)assess:blue=pyblueiris.BlueIris(sess,USER,PASS,PROTOCOL,HOST)awaitblue.update_all_information()
BlueIris对象知道的关于服务器的所有信息都存储在attributes属性(dictionary)中。
print(blue.attributes)