From b82d8cddcd0c9d4cffbc5988078d71f7b35823fb Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 17 Dec 2025 17:09:06 +0100 Subject: [PATCH] Fix Birdnet-Go microphone selection override --- birdnet-go/CHANGELOG.md | 2 ++ birdnet-go/rootfs/etc/cont-init.d/99-run.sh | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/birdnet-go/CHANGELOG.md b/birdnet-go/CHANGELOG.md index e898a1ca1..832a4218d 100644 --- a/birdnet-go/CHANGELOG.md +++ b/birdnet-go/CHANGELOG.md @@ -1,5 +1,7 @@ - Added support for configuring extra environment variables via the `env_vars` add-on option alongside config.yaml. See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details. +- Preserve the microphone selected in the BirdNET-Go UI unless the `homeassistant_microphone` option explicitly forces the default device. + ## "nightly-20251028" (01-11-2025) - Minor bugs fixed diff --git a/birdnet-go/rootfs/etc/cont-init.d/99-run.sh b/birdnet-go/rootfs/etc/cont-init.d/99-run.sh index d4cbea279..4e4c02d09 100755 --- a/birdnet-go/rootfs/etc/cont-init.d/99-run.sh +++ b/birdnet-go/rootfs/etc/cont-init.d/99-run.sh @@ -13,11 +13,10 @@ CONFIG_LOCATION="/config/config.yaml" if bashio::config.true "homeassistant_microphone"; then bashio::log.info "homeassistant_microphone option is selected. The audio card config value is set to 'default'. Set in the addon options to which this is set" audio_card="default" + yq -iy ".realtime.audio.source = \"${audio_card}\"" "$CONFIG_LOCATION" else - bashio::log.warning "homeassistant_microphone option is not set, disabling microphone input" - audio_card="" + bashio::log.info "homeassistant_microphone option is not set, keeping audio source configured via the UI" fi -yq -iy ".realtime.audio.source = \"${audio_card}\"" "$CONFIG_LOCATION" ######################## # CONFIGURE birdnet-go #