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.2.tar.gz
(10.0 kB
view hashes)
Built Distribution
Close
Hashes for python_rabbitair-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1261d266581b9a0e63a871f33d46e9feec9351e2a8c0146df75c0a42d7d3a772 |
|
MD5 | 61f011b9444f0f2794800427ff387fec |
|
BLAKE2b-256 | d359cf49b55d714265b7106cf9422deff108db06c636a92b282980905cbb0df5 |