Metadata-Version: 2.3
Name: pyqwikswitch
Version: 1.0.1
Summary: Library to interface Qwikswitch USB Hub
Keywords: asyncio,qwikswitch
Author: Johann Kellerman
Author-email: Johann Kellerman <kellerza@gmail.com>
License: The MIT License (MIT)
         
         Copyright (c) 2016 kellerza
         
         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.
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: aiohttp>=3.12.15
Requires-Dist: attrs>=25.3
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# pyqwikswitch library

QwikSwitch USB Modem library for Python 3

  See http://www.qwikswitch.co.za for more information on the Qwikswitch devices.

  The library contains threaded and async interfaces and supports relays, buttons, LED dimmers and decoding of various [sensors](https://github.com/kellerza/pyqwikswitch/blob/master/pyqwikswitch/qwikswitch.py#L277)

##  QSUsb class

* Get a list of all devices & values. *(http://localhost:2020/&device)*

  `QSUsb.devices()`

  ```
  [{"id": "@0c26e0","name": "buitelig","type": "rel","val": "ON",
        "time": "1460146507","rssi": "45%"},
    .....]
  ```

* Long poll *(http://localhost:8080/&listen)* for device changes and
    button presses. This is non-blocking and should be stopped manually (`.stop()`)

  `QSUsb.listen(callback)`


* Set a specific device according to ID. (dim 5%) or 100 (on) *(http://localhost:8080/@0ac2f0=5)*

  `QSUsb.set(id, value)`

  Dimmers values can be adjusted to get a more linear behaviour by setting `dim_adj` between 1 - 2


## Example usage

See [example.py](./example.py) for a basic usage and tests though the synchronous interface
