Skip to main content

Asynchronous Implementation of the Frontier Silicon API

Project description

python-afsapi

Asynchronous Python implementation of the Frontier Silicon API

Required python libs:

  • requests

Usage

import asyncio
from afsapi import AFSAPI

URL = 'http://192.168.1.XYZ:80/device'
PIN = 1234
TIMEOUT = 1 # in seconds

async def test():
    afsapi = await AFSAPI.create(URL, PIN, TIMEOUT)

    print(f'Set power succeeded? - {await afsapi.set_power(True)}' )
    print(f'Power on: {await afsapi.get_power()}')
    print(f'Friendly name: {await afsapi.get_friendly_name()}')

    for mode in await afsapi.get_modes():
        print(f'Available Mode: {mode}')
    print(f'Current Mode: {await afsapi.get_mode()}')

    for equaliser in await afsapi.get_equalisers():
        print(f'Equaliser: {equaliser}')

    print(f'EQ Preset: {await afsapi.get_eq_preset()}' )

    for preset in await afsapi.get_presets():
        print(f"Preset: {preset}")

    print(f'Set power succeeded? - {await afsapi.set_power(False)}')
    print(f'Set sleep succeeded? - {await afsapi.set_sleep(10)}')
    print(f'Sleep: {await afsapi.get_sleep()}')
    print(f'Get power {await afsapi.get_power()}' )


loop = asyncio.new_event_loop()
loop.run_until_complete(test())

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

afsapi-0.3.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

afsapi-0.3.0-py2.py3-none-any.whl (15.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file afsapi-0.3.0.tar.gz.

File metadata

  • Download URL: afsapi-0.3.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for afsapi-0.3.0.tar.gz
Algorithm Hash digest
SHA256 51a27cf9b149423a2bc1adc46b820f07898c27d9497d611e85113054bd6ccb2c
MD5 46f2aa5c86bf7b9fcf4c4412cf473187
BLAKE2b-256 b9e5eb48d1d32c15fb9eaa999bd4f393915cc8394a40d95879a39aacee40b1a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for afsapi-0.3.0.tar.gz:

Publisher: python-publish.yml on wlcrs/python-afsapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file afsapi-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: afsapi-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for afsapi-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9dfa250c30134aae5c8077189186d8efac3f1e9217f426f9a02e7b20e2006c56
MD5 13390e56f580c2e4a0373d21a883a862
BLAKE2b-256 8f3cf5dfc85145ea0f2d42e323ef6e832c026e5a68239701c0c3f2ad3e6a4ac9

See more details on using hashes here.

Provenance

The following attestation bundles were made for afsapi-0.3.0-py2.py3-none-any.whl:

Publisher: python-publish.yml on wlcrs/python-afsapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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