Metadata-Version: 2.1
Name: winix
Version: 0.1.0
Summary: Programmatically control the Winix C545
Home-page: https://github.com/hfern/winix
Author: Hunter Fernandes
Author-email: hunter@hfernandes.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: warrant
Requires-Dist: warrant-lite
Requires-Dist: requests

# Winix Controller

This is a Python library for controlling Winix C545 Air Purifier
devices. I reverse-engineered the API calls from the Android app. There
are a few weird idiosyncrasies with the Winix backends.

Included in this package is a CLI program `winixctl`.

## Setup

Install using PyPI: `pip install winix`.
You then have access to the `winix` module in python as well
as the `winixctl` command for shell (which uses the library).

## `winixctl` CLI

```
~/dev/winix(master*) » winixctl                                                                                                                                                                                                 hfern@arrakis
usage: winixctl [-h] {login,refresh,devices,fan,power} ...

Winix C545 Air Purifier Control

positional arguments:
  {login,refresh,devices,fan,power}
    login               Authenticate Winix account
    refresh             Refresh account device metadata
    devices             List registered Winix devices
    fan                 Fan speed controls
    power               Power controls

optional arguments:
  -h, --help            show this help message and exit
```

In order to control your device, you first must run `winixctl login`.
this will save a token from the Winix backend in a file on your system
at `~/config/winix/config.json`. It will prompt you for a username
and password. You can use the `--username` and `--password` flags as well.


You can see the devives registered to your winix account
with `winixctl devices`.

    ~/dev/winix(master*) » winixctl devices
    1 devices:
    Device#0 (default) -------------------------------
          Device ID : 123456abcde_********** (hidden)
                Mac : 123456abcde
              Alias : Bedroom
           Location : SROU

    Missing a device? You might need to run refresh.

The last portion of the Device ID is hidden as it can be used to control
the device.


