Metadata-Version: 2.1
Name: philips-air-purifier-ac2889
Version: 2.0.0
Summary: A simple client to control the Philips AC2889 air purifier.
Author: marcinooo
License: The MIT License (MIT)
        
        Copyright (c) 2019 martinwachofficial
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/marcinooo/philips-air-purifier
Project-URL: Issues, https://github.com/marcinooo/philips-air-purifier/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: requests
Requires-Dist: pycryptodome
Requires-Dist: pycryptodomex
Provides-Extra: test
Requires-Dist: pylint ; extra == 'test'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: ddt ; extra == 'test'

===============================
Philips Air Purifier Controller
===============================

.. image:: https://dl.circleci.com/status-badge/img/gh/marcinooo/philips-air-purifier/tree/main.svg?style=svg
    :target: https://dl.circleci.com/status-badge/redirect/gh/marcinooo/philips-air-purifier/tree/main

|

:Author: marcinooo
:Tags: philips air purifier, python, client, api

:abstract: 

    A simple client to control the Philips AC2889 air purifier.

.. contents ::


Description
===========

The package is a simple interface for controlling the Philips AC2889 air purifier. It allows read parameters and set parameters.

Philips AC2889:

.. image:: philips_air_purifier_ac2889.png
    :alt: Philips AC2889
    :scale: 20%

|

Installation
============

Install from PyPi:

``pip install philips-air-purifier-ac2889``

Install from github:

``$ pip install git+https://github.com/marcinooo/philips-air-purifier.git``

|

Usage
=====

Simple example:

.. code:: python

    from philips_air_purifier_ac2889 import AirPurifier


    philips_air_purifier = AirPurifier(host='192.168.1.21').connect()

    data = philips_air_purifier.get()
    print(data)

    print('Power on...')
    philips_air_purifier.set(pwr='1')  # power on

    if isinstance(data['om'], int) and int(data['om']) <= 2:
        new_speed = str(int(data['om']) + 1)
        print(f'Increasing device speed from {data["om"]} to {new_speed}...')

    else:
        new_speed = '1'
        print(f'Decreasing device speed from {data["om"]} to {new_speed}...')

    philips_air_purifier.set(mode='M', om=new_speed)


List of all allowed parameters you can find in dictionary: 

.. code:: python

    import pprint
    from philips_air_purifier_ac2889 import ALLOWED_PARAMETERS


    pprint.pprint(ALLOWED_PARAMETERS)


See *examples* directory :grinning:.

.. note::

    Some parameters must be set together:

    - setting speed in manual mode: ``philips_air_purifier.set(mode='M', om='2')``

    - setting manual with speed: ``philips_air_purifier.set(mode='M', om='s')``


|

License
=======

license_ (MIT)

.. _license: https://github.com/marcinooo/philips-air-purifier/blob/master/LICENSE.txt

