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.1.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.1-py2.py3-none-any.whl (15.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: afsapi-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 10632841c2b5c1efb3a5d96c33471f75a4ad15c0221c9cac940fd6c7a1d13b42
MD5 528f98c65ac01d3ad4d4955492a55aa6
BLAKE2b-256 c492c11174417c560b5670a9904eb62cbde606e53910a9fb2a5d88079f833aed

See more details on using hashes here.

Provenance

The following attestation bundles were made for afsapi-0.3.1.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.1-py2.py3-none-any.whl.

File metadata

  • Download URL: afsapi-0.3.1-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.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d777a6779c938ea2f6202d00828d94ca6d0293aa6d4a35506ee9957c87ff0c0a
MD5 09abb8acf4b6c86882445d32ba281c56
BLAKE2b-256 e65c1ed52daa3d3990a743be1609beb864fda7d84464ce26700f952f2f49435f

See more details on using hashes here.

Provenance

The following attestation bundles were made for afsapi-0.3.1-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