Ubiquiti UVC NVR的远程控制客户端
项目描述
本库(和工具)中的API不应被视为稳定!
安装
$ pip install mficlient
要开始,设置您的连接信息如下
$ export MFI="https://user:password@192.168.1.123:6443"
然后您可以运行客户端,例如
$ mfi dump_sensors Model | Label | Tag | Value | Extra ------------------------------------------------------------------------------- Output 12v | Relay Control | output | 0 | 0.0 Output 24v | Relay | output | 0 | 0.0 Ubiquiti mFi-THS | Temp | temperature | 14.3 | None Input Digital | Garage Door | input | 1 | None Outlet | Heater Control | active_pwr | 5.810242 | 1.0 Ubiquiti mFi-CS | Furnace | amps | 1.0539 | None Ubiquiti mFi-CS | Water Heater | amps | 0.0 | None $ mfi control_device --device 'Heater Control' --state on
客户端API示例
>>> c = mficlient.MFiClient('192.168.1.123', 'admin', 'password') >>> p = c.get_port(label='Water Heater Control') >>> p.model 'Outlet' >>> p.value 5.746462 >>> p.tag 'active_pwr' >>> p.data {'rpt_time': 1456258144771, 'mac': 'redacted', 'locked': False, 'label': 'Water Heater Control', 'wattHours': 8001.875, 'y': 222.18320610687024, 'map_id': 'redacted', 'output': 1.0, 'fovrotation': 0, 'active_pwr': 5.746462, 'pf': 0.678653, 'reported_val': 1.0, '_id': 'redacted', 'i_rms': 0.069931, 'fovradius': 10, 'v_rms': 121.082737, 'val_time': 1456258144000, 'port': '1', 'energy_sum': 8001.875, 'wattHoursBase': 0.0, 'tag': 'active_pwr', 'val': 5.746462, 'wh_rpt_time': 1456258144761, 'model': 'Outlet', 'x': 564.8839694656489, 'fovangle': 1.5707963267948966, 'output_val': 1.0} >>> p.control(False)
项目详情
下载文件
下载适合您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源代码分发
mficlient-0.5.0.tar.gz (11.4 kB 查看哈希值)
构建分发
mficlient-0.5.0-py3-none-any.whl (11.1 kB 查看哈希值)