Deploy rearchitected MusicMouse backend + web frontend
The app grew a python-backend/ and a web/ frontend, so pi_musicmouse no longer matches it. Rework the role: - Install a pinned uv and build the venv with Python 3.13; Raspbian Bookworm's python3 is 3.11 and the backend uses PEP 695 syntax. - pip install python-backend/ instead of a requirements.txt, and take the systemd unit straight from the checkout so it can't drift. - Build web/ on the control machine (no npm on the Pi) and rsync web/dist over. Chain the checkout -> install -> build -> sync -> restart steps through handlers so a run with no repo change does nothing. - Per-host config files (config-<host>.yml); the schema now differs between a host with a real mouse and a display-only one. - Version to deploy is per host (musicmouse_version), no default. Add pi_kiosk: autologin user running startx with Firefox in kiosk mode and no window manager, for a Pi with a monitor attached. Enabled by mediapi_has_monitor, defaulting off. Turn musicdolphin into a display-only instance: serial and audio simulated, driven entirely through the kiosk page. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
29
roles/pi_musicmouse/files/config-musicdolphin.yml
Normal file
29
roles/pi_musicmouse/files/config-musicdolphin.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# musicdolphin: display-only instance. No physical mouse attached (for
|
||||
# now), so serial and audio are both "simulate" - the web front-end (shown locally in
|
||||
# the pi_kiosk role's Firefox kiosk window, and reachable on the LAN for a tablet) is a
|
||||
# complete way to drive the player on its own. `figures` still needs at least one entry
|
||||
# (the schema requires it) even though nothing will ever scan a tag here.
|
||||
general:
|
||||
library:
|
||||
root: /media/musicmouse
|
||||
|
||||
serial_port: "simulate"
|
||||
alsa_device: "simulate"
|
||||
|
||||
web:
|
||||
host: "0.0.0.0"
|
||||
port: 8080
|
||||
static_dir: /opt/musicmouse/web/dist
|
||||
|
||||
button_leds_brightness: 0.5
|
||||
volume_increment: 5
|
||||
min_volume: 0
|
||||
max_volume: 100
|
||||
|
||||
figures:
|
||||
# Placeholder - serial_port is "simulate" so no reader ever reports a tag id, but the
|
||||
# schema requires at least one figure to be configured.
|
||||
placeholder:
|
||||
id: "0000000001"
|
||||
colors: ["#ffffff", "#ffffff", "#000000", "#ffffff"]
|
||||
@@ -1,17 +1,26 @@
|
||||
---
|
||||
general:
|
||||
library:
|
||||
root: /media/musicmouse
|
||||
|
||||
serial_port: "/dev/ttyUSB0"
|
||||
alsa_device: softvol_effects
|
||||
mqtt:
|
||||
user: musicmouse
|
||||
password: KNLEFLZF94yA6Zhj141
|
||||
server: homeassistant
|
||||
hass_url: https://ha.bauer.tech
|
||||
hass_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4N2ExMzM2ZmQ4ZWQ0ZDgzOWZhMjU3NmZjYTg1NWQ1ZiIsImlhdCI6MTcwNDAyOTUyOSwiZXhwIjoyMDE5Mzg5NTI5fQ.vx9L5bTSey98uc8TwodShaEXSMr-hjXugPsNviR_fEw" # noqa: yaml[line-length]
|
||||
web:
|
||||
host: "0.0.0.0"
|
||||
port: 8080
|
||||
static_dir: /opt/musicmouse/web/dist
|
||||
|
||||
# The old hass_url/hass_token keys don't exist in the current schema - HA
|
||||
# integration now lives under general.ha (url, token, devices, scenes; needs at
|
||||
# least one device or scene) - see config.yml.example. Add it back once picked.
|
||||
button_leds_brightness: 0.5
|
||||
volume_increment: 5
|
||||
min_volume: 23
|
||||
max_volume: 70
|
||||
serial_port: "/dev/ttyUSB0"
|
||||
|
||||
figures:
|
||||
elefant:
|
||||
@@ -1,11 +0,0 @@
|
||||
[Unit]
|
||||
Description=MusicMouse Player
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/opt/musicmouse_venv/bin/python /opt/musicmouse/espmusicmouse/host_driver/main.py /media/musicmouse/
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user