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.2.9.tar.gz (17.0 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.2.9-py2.py3-none-any.whl (15.4 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for afsapi-0.2.9.tar.gz
Algorithm Hash digest
SHA256 22cb2ca66d196afb0703ff8572f033cbe549f204440109f729c8ef93578163c2
MD5 eeeb3825f8b48fa5740139ef06dea96d
BLAKE2b-256 67b3e0e0f26c7b920e831c645e53d20a240859d29fa34d3327bc185edc84d229

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: afsapi-0.2.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.4 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.2.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5b1277385a496801f4e1bee1dd7b1c166edcecc9920d2d721ceb66ebeef738d4
MD5 75bc94bbd08240480c117e9e86cfea27
BLAKE2b-256 f0b8a23c220365732ec99e34572d75fd373b383c5d687c14b7d1e0707ffb432a

See more details on using hashes here.

Provenance

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