Skip to main content

Library to interface Qwikswitch USB Hub

Project description

pyqwikswitch library codecov

QwikSwitch USB Modem library for Python 3. The library supports relays, buttons, LED dimmers and decoding of various sensors

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

The library is used in the Home Assistant QwikSwitch integration

QSUsb class

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

    QSUsb.devices()

    [{"id": "@0c26e0","name": "Light 1","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)

    Dimmer values can be adjusted to get a more linear behavior by setting dim_adj between 1 - 2

Example usage

See example.py for a basic usage and tests though the synchronous interface

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

pyqwikswitch-1.0.6.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyqwikswitch-1.0.6-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file pyqwikswitch-1.0.6.tar.gz.

File metadata

  • Download URL: pyqwikswitch-1.0.6.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.2

File hashes

Hashes for pyqwikswitch-1.0.6.tar.gz
Algorithm Hash digest
SHA256 f168d39977d8dd6634b4ef8711c8b01395583b9a54e1cc5f9e0230fa4494e402
MD5 d7c566cf2bf96bcd99360f2f402a2d76
BLAKE2b-256 a34b33ad3fb44a9e6cc660a61710377ef6e53f7eeb919187b4efad9810877987

See more details on using hashes here.

File details

Details for the file pyqwikswitch-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for pyqwikswitch-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7e4eff9362dab6b645bf1649337d832fbddc38af0c5a7de511be375a282b0ecc
MD5 2ef914a0e5de299ef816d881d44b492a
BLAKE2b-256 61332592ca623bb73516e84b39b1fa952dc247f1ce1b182d9a80ef89e7d179c4

See more details on using hashes here.

Supported by

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