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.0a2.tar.gz (9.1 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.0a2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for harp_audioswitch-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 322d7f6caf1ae848baba0e39db6b7327871ac0e43b5054c8976023cda4b68d06
MD5 6d763159484ccd135fb589a0adbd4839
BLAKE2b-256 41595c65e3cf1141fae2688e73293a14135467278524709609408657a604190c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for harp_audioswitch-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 847ae289aafc625c0d35d783f319f11fe0c9e1aea686f5d12f61b425b3171ae6
MD5 b5bd0d0e16c2749e595d02b78df25b10
BLAKE2b-256 a0156f1757332f28a228f058a8acf2548740666b5c2e7fe669b361f790acc86f

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