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 hashes)
Built Distribution
Close
Hashes for pyhifiberry-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97c1b71dcf7bd937781331aca73d35fcdff54cc619842f5cd9c0cf119937df75 |
|
MD5 | 2ddb76aaf095341e5821e678be2f4389 |
|
BLAKE2b-256 | a0c5a3c8bdee53bf002c6160ff0763208bb725e3597adc9ba5b22f5e578eb0fc |