Metadata-Version: 2.4
Name: qwikswitch_api
Version: 0.0.2
Summary: A Python wrapper around the QwikSwitch API
Author-email: Riaan Hanekom <riaan@hanekom.io>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: requests
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: packagename[docs,tests]; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: docs
Requires-Dist: pydata-sphinx-theme; extra == 'docs'
Requires-Dist: sphinx; extra == 'docs'
Provides-Extra: tests
Requires-Dist: pytest; extra == 'tests'
Requires-Dist: pytest-cov; extra == 'tests'
Requires-Dist: pytest-flakes; extra == 'tests'
Requires-Dist: requests-mock; extra == 'tests'
Description-Content-Type: text/markdown

# qwikswitch-api

A Python wrapper for the [Qwikswitch API](https://qwikswitch.com/doc/), used for remotely controlling [Qwikswitch](https://qwikswitch.com/) devices using the [Wifi Bridge](https://www.qwikswitch.co.za/products/wifi-bridge).

An alternative (local) way of controlling Qwikswitch devices is with a USB Modem.  If this is the device that you have, see the [pyqwikswitch library](https://github.com/kellerza/pyqwikswitch) instead.

## Usage

The following operations are implemented:
* Keys - Generate API Keys (`generate_api_keys`)
* Keys - Delete API Keys (`delete_api_keys`)
* Control - Control a device (`control_device`)
* State - Get all device status (`get_all_device_status`)

Device history is *not* implemented in this library yet as I don't have access to these devices.  

If you have access to devices that record history, please open an issue detailing sample responses from `get_all_device_status` and the history calls. 

### Installation

```bash
pip install qwikswitch-api
```

### Sample code

Sample usage to control a device:

```python
from qwikswitch.qsapi import QSApi

api = Qwikswitch('email', 'masterkey')
api_keys = api.generate_api_keys()
api.control_device(api_keys, '@123450', 100)
```

To list all current device statuses:

```python
devices = api.get_all_device_status(api_keys)
```

