Asynchronous Implementation of the Frontier Silicon API
Project description
python-afsapi
Asynchronous Python implementation of the Frontier Silicon API
- This project was started in order to embed Frontier Silicon devices in Home Assistant (https://home-assistant.io/)
- Inspired by:
- https://github.com/flammy/fsapi/
- https://github.com/tiwilliam/fsapi
- https://github.com/p2baron/fsapi
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10632841c2b5c1efb3a5d96c33471f75a4ad15c0221c9cac940fd6c7a1d13b42
|
|
| MD5 |
528f98c65ac01d3ad4d4955492a55aa6
|
|
| BLAKE2b-256 |
c492c11174417c560b5670a9904eb62cbde606e53910a9fb2a5d88079f833aed
|
Provenance
The following attestation bundles were made for afsapi-0.3.1.tar.gz:
Publisher:
python-publish.yml on wlcrs/python-afsapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
afsapi-0.3.1.tar.gz -
Subject digest:
10632841c2b5c1efb3a5d96c33471f75a4ad15c0221c9cac940fd6c7a1d13b42 - Sigstore transparency entry: 1227968936
- Sigstore integration time:
-
Permalink:
wlcrs/python-afsapi@3304de8b2d200d1fe67732cab978567150c3e873 -
Branch / Tag:
refs/tags/0.3.1 - Owner: https://github.com/wlcrs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3304de8b2d200d1fe67732cab978567150c3e873 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d777a6779c938ea2f6202d00828d94ca6d0293aa6d4a35506ee9957c87ff0c0a
|
|
| MD5 |
09abb8acf4b6c86882445d32ba281c56
|
|
| BLAKE2b-256 |
e65c1ed52daa3d3990a743be1609beb864fda7d84464ce26700f952f2f49435f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
afsapi-0.3.1-py2.py3-none-any.whl -
Subject digest:
d777a6779c938ea2f6202d00828d94ca6d0293aa6d4a35506ee9957c87ff0c0a - Sigstore transparency entry: 1227968945
- Sigstore integration time:
-
Permalink:
wlcrs/python-afsapi@3304de8b2d200d1fe67732cab978567150c3e873 -
Branch / Tag:
refs/tags/0.3.1 - Owner: https://github.com/wlcrs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3304de8b2d200d1fe67732cab978567150c3e873 -
Trigger Event:
release
-
Statement type: