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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: afsapi-0.2.4.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for afsapi-0.2.4.tar.gz
Algorithm Hash digest
SHA256 550902fa058315a3d5656b55fcad4cb6eb3cf734897481f7b03befa63abb577c
MD5 00ff29755082176cb6a915c6bd1038ff
BLAKE2b-256 4d093afebce0501352c2d029c0c2996c2391edef83a93228a75bfb1e9cd81ddb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: afsapi-0.2.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for afsapi-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8a3fc471e94a52a24819a8a7391f56e726bb4a9a35ab7561d8a595418d9c097e
MD5 5b6c1594ef5ae6b621f881c064eb0aae
BLAKE2b-256 aeace0cf3951db798ce11aa1dbcf774f49a744a52874af76379502cfb82af3a4

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