Tion Magic Air API
Project description
Tion Api
This package provides API to control Tion breezer
Usage:
import os
import logging
from tion import TionApi, Breezer, Zone, MagicAir
logging.basicConfig(level=logging.INFO)
# initialization api with no saving auth information (for test only)
email, password = os.environ.get("TION_AUTH").split(',')
api = TionApi(email, password, auth_fname=None)
# getting current co2 level from magicair
magicair = api.get_devices(name_part="magic")[0]
print(f"magicair.co2: {magicair.co2}")
# getting breezer
breezer = api.get_devices(name_part="breezer")[0]
# setting manual mode for breezer zone
breezer.zone.mode = "manual"
assert breezer.zone.send() is True, "Failed to send zone data"
print(f"breezer.zone.mode: {breezer.zone.mode}")
# setting breezer speed manually
breezer.speed = 3
assert breezer.send() is True, "Failed to send breezer data"
print(f"breezer.is_on: {breezer.is_on}, breezer.speed: {breezer.speed}")
# setting air source to outside
breezer.gate = 2
assert breezer.send() is True, "Failed to send breezer data"
print(f"breezer.is_on: {breezer.is_on}, breezer.speed: {breezer.speed}, breezer.gate: {breezer.gate}")
# setting auto mode for breezer's zone
breezer.zone.mode = "auto"
assert breezer.zone.send() is True, "Failed to send zone data"
print(f"breezer.zone.mode: {breezer.zone.mode}")
# setting breezer minimum speed to 3 and maximum to 6
breezer.speed_min_set = 3
breezer.speed_max_set = 6
assert breezer.send() is True, "Failed to send breezer data"
print(f"breezer.speed_min_set: {breezer.speed_min_set}, breezer.speed_max_set: {breezer.speed_max_set}")
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
tion-1.28.tar.gz
(8.9 kB
view details)
Built Distribution
tion-1.28-py3-none-any.whl
(8.6 kB
view details)
File details
Details for the file tion-1.28.tar.gz
.
File metadata
- Download URL: tion-1.28.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8f950f48dfedce5049bc059f77fb11b59f48313d499f26e6f76fe442c6997ba |
|
MD5 | 2af4aeb29a986ec52438619627769758 |
|
BLAKE2b-256 | 26715cfca5bb66f9a9e283fb2defa98e2e5c0aa7d3b78a47b925bcd2215af045 |
File details
Details for the file tion-1.28-py3-none-any.whl
.
File metadata
- Download URL: tion-1.28-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd3246938118a2a05c8b79688d2f697e924df6332014d7ca605d77ee40db62c2 |
|
MD5 | 25fcf167d482cf5f2a96f087b3403bcd |
|
BLAKE2b-256 | 95dea2779720ad0aea2bfac927f139cbe6baa9dbc5dbbefaf32d6dae46aa6d98 |