Skip to main content

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


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)

Uploaded Source

Built Distribution

python_rabbitair-0.0.3-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

Supported by

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