Python library to interface with Hifiberry OS API.
Project description
pyhifiberry
Python library to interface with Hifiberry OS API (audiocontrol2). There are two APIs available:
This package is targeting mainly the needs for a hifiberry integration for Home assistant.
Usage example of the socketio API
Runs for 100 secs and prints artist name if metadata events occure.
import asyncio
from pyhifiberry.audiocontrol2sio import Audiocontrol2SIO
def metadata_callback(metadata):
print(metadata['artist'])
async def main():
api = await Audiocontrol2SIO.connect(<HIFIBERRY_IP>, <HIFIBERRY_PORT>)
api.metadata.add_callback(metadata_callback)
await asyncio.sleep(100)
if __name__ == '__main__':
asyncio.run(main())
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
pyhifiberry-0.1.0.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file pyhifiberry-0.1.0.tar.gz
.
File metadata
- Download URL: pyhifiberry-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.13.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a644d0015f048b8ab79ca4421658b8fad83b1377a6c65ed21a346683c0f7ec8 |
|
MD5 | 4d61d151f089451583c67494f25de56d |
|
BLAKE2b-256 | b83b672489a06c86f7cab83d09b21a0e1187b1c5a1fef4fc01044ffbdf773ff9 |
File details
Details for the file pyhifiberry-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pyhifiberry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.13.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97c1b71dcf7bd937781331aca73d35fcdff54cc619842f5cd9c0cf119937df75 |
|
MD5 | 2ddb76aaf095341e5821e678be2f4389 |
|
BLAKE2b-256 | a0c5a3c8bdee53bf002c6160ff0763208bb725e3597adc9ba5b22f5e578eb0fc |