Python library for local control of RabbitAir air purifiers
Project description
RabbitAir Python library
This library can be used to control RabbitAir air purifiers over a local network.
Usage
#! /usr/bin/env python3
import asyncio
from rabbitair import Mode, Speed, UdpClient
async def main():
with UdpClient("ip", "token") as client:
# Getting the current state of the air purifier
state = await client.get_state()
print(state)
# Controlling the air purifier
print("Power Off")
await client.set_state(power=False)
await asyncio.sleep(3)
print("Power On")
await client.set_state(power=True)
await asyncio.sleep(3)
print("Set Speed to High")
await client.set_state(speed=Speed.High)
await asyncio.sleep(3)
print("Set Speed to Low")
await client.set_state(speed=Speed.Low)
await asyncio.sleep(3)
print("Set Mode to Auto")
await client.set_state(mode=Mode.Auto)
asyncio.run(main())
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
python-rabbitair-0.0.3.tar.gz
(10.3 kB
view hashes)
Built Distribution
Close
Hashes for python_rabbitair-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 771032bda4ecd99cced0eda6ff0185c3214ed52f0170c9914ad0e94061404c2d |
|
MD5 | b387ff5b6c1e905ea1f4cf45ece89261 |
|
BLAKE2b-256 | a9b1028e5be82eb506da763d249f6c29f2c3b2f07420016bd1c075fe0a5cf754 |