Skip to main content

pycoolmasternet-async

A Python 3 library for interacting with a CoolMasterNet HVAC bridge. This is a fork of pycoolmaster, modified to present an async interface and some other small changes.

Installation

You can install pycoolmasternet-async from PyPI:

pip3 install pycoolmasternet-async

Python 3.13 and above are supported.

How to use

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()

Errors

Errors raised by this library derive from CoolMasterNetError:

  • CoolMasterNetConnectionError - the bridge could not be reached, or did not answer as expected. Also a ConnectionError, and so an OSError.
  • CoolMasterNetCommandError - the bridge rejected a command. Also a ValueError.

They subclass the builtins previously raised, so existing except OSError or except ValueError handlers keep working. Note that connection failures raised by asyncio itself (for example TimeoutError, or socket.gaierror for an unresolvable host) still propagate as plain OSError subclasses.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycoolmasternet_async-0.2.5.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycoolmasternet_async-0.2.5-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file pycoolmasternet_async-0.2.5.tar.gz.

File metadata

  • Download URL: pycoolmasternet_async-0.2.5.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pycoolmasternet_async-0.2.5.tar.gz
Algorithm Hash digest
SHA256 c4ec728fbbe913b62193cbc57f35d06d5e25a6121ec81312b868c47d595990ad
MD5 0139b4d2b40bf6913b0c0fe9f7a7c717
BLAKE2b-256 d4aac0276499d97fde5b2a9433a562dae72db9f19d6f590f6b6a782c6194cd7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoolmasternet_async-0.2.5.tar.gz:

Publisher: release.yml on OnFreund/pycoolmasternet-async

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycoolmasternet_async-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for pycoolmasternet_async-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 86b28e9b847116cc54997f49aec689839d666ec845ed30e2e713bbade918e3f2
MD5 6b0360ca8aec28a88e07dec85cf04e0b
BLAKE2b-256 7cf53c8885b8f6ae1d0a2974bf8f06f0e75f3eb149ab0da050340fe204e5fe44

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoolmasternet_async-0.2.5-py3-none-any.whl:

Publisher: release.yml on OnFreund/pycoolmasternet-async

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page