Adds the volume display effect to these boards that have LED Ring, when controlling the volume for LVA:
- Satellite 1 HAT Board
- ReSpeaker 4-Mic Array HAT
- ReSpeaker USB Mic Array v2.0
This animation appears on the LED ring temporarily to display an arc that sweeps clockwise when the volume increases and anti-clockwise when the volume decreases. Triggers by the volume_changed event.
* Restore stop word sensitivity from preferences on startup
The Home Assistant number entity persists preferences.stop_word_sensitivity
whenever it changes, but nothing ever read it back. main() did not pass
stop_word_threshold when constructing ServerState, so it always took the
dataclass default of 0.5, and lowering the sensitivity in Home Assistant
silently reverted at the next restart.
volume and mic_volume are restored at startup, and the two wake word
sensitivities are restored when wake models load. Only the stop word was
missed, so the block that syncs all three sensitivity entities back to Home
Assistant was pushing a default it had never loaded.
Restored alongside volume and clamped the same way. The resolution lives in a
small helper so it can be covered by tests.
* Move the threshold helper to models.py so tests do not import __main__
CI has no PulseAudio daemon. Importing linux_voice_assistant.__main__ pulls in
`import soundcard as sc`, and soundcard/pulseaudio.py instantiates _PulseAudio()
at module scope, which asserts on a live connection. So the four new tests
failed on the runner while passing locally, where a daemon happens to be
running.
That is also why no other test in the suite imports __main__, and why the
existing tests in test_main.py re-implement the logic they check rather than
calling it.
initial_stop_word_threshold() now lives in models.py, which owns both fields it
resolves between: Preferences.stop_word_sensitivity and
ServerState.stop_word_threshold. It imports cleanly, test_models.py already
imports it, and the reference to the ServerState default becomes local.
Behaviour is unchanged. Verified by reproducing the CI environment locally with
PULSE_SERVER pointed at a nonexistent socket: 4 failed before, 298 pass after.
---------
Co-authored-by: ryan felder <7475484+ryanfelder@users.noreply.github.com>
Co-authored-by: Omar Amin <65174210+omaramin-2000@users.noreply.github.com>
* Add --music-output-device to route music separately from voice
Music/media and TTS both play through --audio-output-device today, with no
way to send them to different sinks. Add an optional --music-output-device
(env MUSIC_OUTPUT_DEVICE) that the music player uses instead, defaulting to
--audio-output-device so existing setups are unchanged. Wired through
docker-entrypoint.sh and documented in the README and install docs.
* docs: fix swapped Default/Description columns in env var table
The MIC_VOLUME, MIC_AUTO_GAIN, MIC_NOISE_SUPPRESSION and
AUDIO_INPUT_CHANNELS rows had their Default and Description columns
swapped relative to the table header; fix the ordering and the
'Suppresion' misspelling. Also repair the UNMUTE_SOUND row, whose
description was garbled and which was missing its closing table pipe.
---------
Co-authored-by: Matthew Davis <fedoraproject@virtual.drop.net>
Co-authored-by: Florian Asche <github@florian-asche.de>
Co-authored-by: Omar Amin <65174210+omaramin-2000@users.noreply.github.com>
Fix the syntax error in the shell script where the comparison was
incorrectly structured, and remove the redundant passing of the
variable value to the flag.
The core problem in #164 (config fully overriding pipewire.conf) was
already fixed by switching to pipewire.conf.d. This adds the
remaining performance-tuning recommendation (libpipewire-module-rt)
from the issue thread that never made it into the docs, to reduce
audio dropouts on hardware like the Raspberry Pi 3B.
Closes#164
* feat(ai): integrate Kilo agent framework and coding instructions
Add configuration files, agent definitions, and skill sets to enable
AI-driven development workflows and standardized agent behavior.
- Update `actions/checkout` from v3 to v4 in workflows
- Enable `allow-unsafe-pr-checkout` in `docker-build-pr.yml` to support
PR builds with updated checkout version
Introduce essential GitHub repository files to standardize community
contributions and automate maintenance tasks.
- Add AI usage policy and contribution guidelines
- Implement issue and pull request templates for consistent reporting
- Configure Dependabot for automated dependency updates
- Add workflow for automated PR labeling
- Include funding information and repository metadata
Improve the developer experience by providing structured setup scripts,
VS Code workspace configurations, and detailed documentation.
- Add VS Code workspace configuration and recommended settings
- Update README.md with system requirements and VS Code setup instructions
- Refactor `script/setup` to include Python 3.11+ validation and system dependency checks
- Add option to skip PulseAudio wait in `docker-entrypoint.sh` for local development
- Update `.gitignore` to ensure consistent version file handling
This PR adds the ability to select microWakeWord/openWakeWord models using the wake word dropdown selection via the HA device page at any time without the need for restarting the app/container to change the wake word path.
* Add type ignore for stop_word attribute assignment
Added type ignore comment for stop_word attribute.
* Refactor exception handling in disconnect process
Updated exception handling to use pylint directive for broad exceptions.
* Fix callback lambda for broadcasting state
The ESPHome API server delivered asynchronous entity-state changes to a single
connection (the entity's `server`), which every new connection reassigns. A
second API client — a diagnostic tool, a second dashboard, or Home Assistant's
own overlapping reconnect — therefore stole state delivery, leaving Home
Assistant stuck on a stale state (e.g. `media_player` showing `playing` after
playback had finished). `connection_lost` also stopped the shared music/TTS
players for *any* dropped connection.
- models.py: add a per-server connection registry and a `broadcast()` helper.
- satellite.py: register/deregister connections in connection_made/_lost; only
stop shared playback when the last client disconnects; handle the standard
`SubscribeStatesRequest` by replaying current entity state to the subscriber.
- entity.py: push playback-completion state via broadcast to all clients.
Co-authored-by: Omar Amin <65174210+omaramin-2000@users.noreply.github.com>
Co-authored-by: Florian Asche <github@florian-asche.de>
* Update libmpv initialization to use demuxer_max_bytes and cache_secs
instead of the deprecated cache-size property. This ensures more
predictable memory usage and better buffering behavior during
playback.
Use events and commands to control custom onboard leds and buttons. Can be used to communicate with an external Python script via a WebSocket API running in a container alongside LVA.