Skip to main content

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.1.tar.gz (85.1 kB view hashes)

Uploaded Source

Built Distribution

pyhifiberry-0.1.1-py3-none-any.whl (109.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page