File: README.md

package info (click to toggle)
pycoolmasternet-async 0.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 92 kB
  • sloc: python: 253; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 1,509 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# pycoolmasternet-async

A Python 3 library for interacting with a [CoolMasterNet](https://coolautomation.com/products/coolmasternet/) HVAC bridge.
This is a fork of [pycoolmaster](https://github.com/koreth/pycoolmasternet), modified to present an async interface and some other small changes.

## Installation

You can install pycoolmasternet-async from [PyPI](https://pypi.org/project/pycoolmasternet-async/):

    pip3 install pycoolmasternet-async

Python 3.7 and above are supported.


## How to use

```python
from pycoolmasternet_async import CoolMasterNet
cool = CoolMasterNet("coolmaster")

# Supply the IP address and optional port number (default 10102).
cool = CoolMasterNet("192.168.0.123", port=12345, read_timeout=1)

# General information
info = await cool.info()

# Returns a dict of CoolMasterNetUnit objects. Keys are the unit IDs
units = await cool.status()

unit = units["L1.001"]

unit.unit_id

# Temperature unit: Imperial, Celsius
unit.temperature_unit

# Current reading of unit's thermometer
unit.temperature

# Current setting of unit's thermostat
unit.thermostat

# Setters return a new instance with updated info
unit = await unit.set_thermostat(28)

# True if unit is turned on
unit.is_on
unit = await unit.turn_on()
unit = await unit.turn_off()

# Fan speed: low, med, high, auto
unit.fan_speed
unit = await unit.set_fan_speed('med')

# Mode of operation: auto, cool, dry, fan, heat
unit.mode
unit = await unit.set_mode('cool')

# Get fresh info
unit = await unit.refresh()

```