Skip to content

Repository files navigation

python-afsapi

Asynchronous Python implementation of the Frontier Silicon API

Required python libs:

  • requests

Usage

importasynciofromafsapiimportAFSAPIURL='http://192.168.1.XYZ:80/device'PIN=1234TIMEOUT=1# in secondsasyncdeftest():
afsapi=awaitAFSAPI.create(URL, PIN, TIMEOUT)
print(f'Set power succeeded? - {awaitafsapi.set_power(True)}' )
print(f'Power on: {awaitafsapi.get_power()}')
print(f'Friendly name: {awaitafsapi.get_friendly_name()}')
formodeinawaitafsapi.get_modes():
print(f'Available Mode: {mode}')
print(f'Current Mode: {awaitafsapi.get_mode()}')
forequaliserinawaitafsapi.get_equalisers():
print(f'Equaliser: {equaliser}')
print(f'EQ Preset: {awaitafsapi.get_eq_preset()}' )
forpresetinawaitafsapi.get_presets():
print(f"Preset: {preset}")
print(f'Set power succeeded? - {awaitafsapi.set_power(False)}')
print(f'Set sleep succeeded? - {awaitafsapi.set_sleep(10)}')
print(f'Sleep: {awaitafsapi.get_sleep()}')
print(f'Get power {awaitafsapi.get_power()}' )
loop=asyncio.new_event_loop()
loop.run_until_complete(test())

About

Asynchronous python implementation of the Frontier Silicon API

Resources

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages