$ show music-assistant/home-assistant-addon
This repository is a Home Assistant add-on distribution point for Music Assistant, not a standalone application. It packages the Music Assistant server and a companion local audio output add-on as installable Home Assistant add-ons. The repository contains multiple variantsβstable, beta, dev, and nightlyβeach with its own Dockerfile, run script, configuration schema, translations, and changelog. The local_audio add-on provides low-latency playback to local sound cards and is hardened with a custom AppArmor profile. In production, the add-ons run inside Home Assistant OS or a supervised installation. The main entry points are the add-on config.yaml files and the shell scripts that start the Music Assistant server or local audio player. The server exposes a web UI and integrates with Home Assistant; audio flows from music providers to players, with local_audio acting as an output sink. External dependencies include Home Assistant, Docker, the Music Assistant Python server, and system audio libraries. The codebase is primarily operational glue: shell scripts, Dockerfiles, YAML configuration, and security profiles. The most reusable artifacts are the AppArmor profile for sandboxing a network-exposed audio player and the git-ref-based source installer used by the development add-on. The repository is actively maintained, with frequent releases and detailed changelogs, and shows low technical drift relative to current Home Assistant add-on practices.
The LLM identified 2 files worth highlighting for reuse:
A hand-written AppArmor profile that confines the local_audio add-on. It defines restrictive file, network, signal, and child-profile rules so the network-reachable player process cannot access the rest of the host. The detailed comments explain the security model, making it adaptable to other audio daemons or add-ons that need to expose a service while running as root.
A shell script that installs Music Assistant from a user-specified git branch, pull request, or fork inside the add-on container. It handles the tricky parts of source installs: converting git refs to raw GitHub URLs for requirements files, enabling Corepack for the pinned package manager, checking for a valid frontend repo, and avoiding git credential prompts in a terminal-less environment. This is a reusable pattern for any Docker-based add-on that needs to install a Python/Node application from a git ref.