Skip to main content

This is a generated Harp device Python interface that interacts with the Harp protocol.

Project description

harp.audioswitch

PyPI

This is a generated Harp device Python interface that interacts with the Harp protocol.

Installation

You can install the package using uv or pip:

uv add harp.audioswitch

or

pip install harp.audioswitch

Usage example

from harp.protocol import OperationMode
from harp.devices.audioswitch import AudioSwitch

# Example usage of the AudioSwitch device
with AudioSwitch("/dev/ttyUSB0") as device: # For Windows, use "COM8" or similar
    device.info()

    # Set the device to active mode
    device.set_mode(OperationMode.ACTIVE)

    # Get the events
    try:
        while True:
            for event in device.get_events():
                # Do what you need with the event
                print(event.payload)
    except KeyboardInterrupt:
        # Capture Ctrl+C to exit gracefully
        print("Exiting...")
    finally:
        # Do what you need to do to clean up. Disconnect is automatically called with the "with" statement.
        pass

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

harp_audioswitch-0.1.0a1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

harp_audioswitch-0.1.0a1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file harp_audioswitch-0.1.0a1.tar.gz.

File metadata

  • Download URL: harp_audioswitch-0.1.0a1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.17

File hashes

Hashes for harp_audioswitch-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 cd5d5a05a8de85957ec472ec8b15247482f58244db28124aec49ead6319696be
MD5 9fee363ec5248ea1a9eec8cd0b22d1be
BLAKE2b-256 23062d93c9473bbf8d5ff0ce1bf0189af7b5bacca5560bce7e371b03cada2d0c

See more details on using hashes here.

File details

Details for the file harp_audioswitch-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for harp_audioswitch-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 971fdbdb9975c4f98ca827b0d7699602b736fb549ea78f89c478127712410b46
MD5 a063198f70543cf17604fdbdf064b59e
BLAKE2b-256 cea66cffe93103b8b68da3c712378357c54d85aa16c9c26e7afdf952f4d21f81

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