CoolMasterNet暖通空调桥的轻量级PythonAPI
pycoolmasternet的Python项目详细描述
用于与CoolMasterNethvac桥交互的python 3库。
安装
pip安装pycoolmasternet
或者您可以从https://github.com/koreth/pycoolmasternet获取代码
用法
frompycoolmasternetimportCoolMasterNet# Supply the IP address and optional port number (default 10102).## By default, properties will be refreshed by querying the device# if last refresh was more than 1 second ago; pass auto_update=False# to disable that behavior (in which case you will need to call# update_status() explicitly).cool=CoolMasterNet('192.168.0.123',port=12345,auto_update=False)# Returns a list of CoolMasterDevice objectsdevices=cool.devices()# Device's unit ID on the CoolMasterNet bridge, e.g., "L7.001"device.uid# Temperature unit: imperial, celsiusdevice.unit# Current reading of device's thermometerdevice.temperature# Current setting of device's thermostatdevice.thermostatdevice.set_thermostat(28)# True if device is turned ondevice.is_ondevice.turn_on()device.turn_off()# Fan speed: low, med, highdevice.fan_speeddevice.set_fan_speed('med')# Mode of operation: auto, cool, dry, fan, heatdevice.modedevice.set_mode('cool')# Swing mode: horizontal, vertical, auto, 30, 45, 60, stop# Numeric settings are degrees of louver tilt. On read, the property can# be None if the bridge reports that the device doesn't support swing.device.swingdevice.set_swing('30')# Dict with all the properties listed abovedevice.status# Force refresh of status (by default, device auto-updates its status# if most recent update is more than 1 second ago)device.update_status()
许可证
这段代码是在麻省理工学院的许可下发布的。