A fully typed asyncio API for the Polyaire AirTouch AC controllers
Project description
pyairtouch
A fully typed asyncio API for the Polyaire AirTouch AC controllers.
The API supports the AirTouch 4 and AirTouch 5.
A unified public API is provided that encapsulates the underlying AirTouch version.
Example
import asyncio
import pyairtouch
async def main() -> None:
# Automatically discover AirTouch devices on the network.
discovered_airtouches = await pyairtouch.discover()
if not discovered_airtouches:
print("No AirTouch discovered")
return
for airtouch in discovered_airtouches:
print(f"Discovered: {airtouch.name} ({airtouch.host})")
# In this example we use the first discovered AirTouch (typically there is only one per network)
airtouch = discovered_airtouches[0]
# Connect to the AirTouch and read initial state.
success = await airtouch.init()
async def _on_ac_status_updated(ac_id: int) -> None:
aircon = airtouch.air_conditioners[ac_id]
print(
f"AC Status : {aircon.power_state.name} {aircon.mode.name} "
f"temp={aircon.current_temperature:.1f} set_point={aircon.target_temperature:.1f}"
)
for zone in aircon.zones:
print(
f"Zone Status: {zone.name:10} {zone.power_state.name:3} "
f"temp={zone.current_temperature:.1f} set_point={zone.target_temperature:.1f} "
f"damper={zone.current_damper_percentage}"
)
# Subscribe to AC status updates:
for aircon in airtouch.air_conditioners:
aircon.subscribe(_on_ac_status_updated)
# Print initial status
await _on_ac_status_updated(aircon.ac_id)
# Keep the demo running for a few minutes
await asyncio.sleep(300)
# Shutdown the connection
await airtouch.shutdown()
if __name__ == "__main__":
asyncio.run(main())
A more detailed example can be found in examples/example.py. The example can be run using the pdm run example command.
Say Thank You
If you would like to make a donation as appreciation of my work, please use one of the links below:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyairtouch-3.1.0.tar.gz.
File metadata
- Download URL: pyairtouch-3.1.0.tar.gz
- Upload date:
- Size: 80.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.25.3 CPython/3.13.5 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d6abdb2d6417d41849b7debd00ef2e36d899193d2ad4f946cb2c71810e8de1e
|
|
| MD5 |
4fdc822f04ffb436dc9717cd9fa5d117
|
|
| BLAKE2b-256 |
3bd854c6e1022f6f9f6d1be29c5f113d6c9eeb44f267641fe554569a965f5dbd
|
File details
Details for the file pyairtouch-3.1.0-py3-none-any.whl.
File metadata
- Download URL: pyairtouch-3.1.0-py3-none-any.whl
- Upload date:
- Size: 100.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.25.3 CPython/3.13.5 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ed37d078de18d1d3385db4e4297575e217c3428b5725a5d27580e6cedc4e071
|
|
| MD5 |
a92219f4423288730d6a3e0ed74b6edd
|
|
| BLAKE2b-256 |
3fdc773ea40a7d449810ea6fdced1520b4e873d07574b21adb4c7d68f6164ced
|