mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 18:01:03 +01:00
Use ALSA_CARD for REC_CARD
https://github.com/alexbelgium/hassio-addons/issues/1822#issuecomment-2760118399
This commit is contained in:
@@ -57,6 +57,16 @@ else
|
||||
fi
|
||||
fi || true
|
||||
|
||||
# Use ALSA CARD defined in add-on options if available
|
||||
if [ ! -z "${ALSA_CARD:-}" ]; then
|
||||
bashio::log.warning "ALSA_CARD is defined, the birdnet.conf is adapt to use device $ALSA_CARD"
|
||||
for file in "$HOME"/BirdNET-Pi/birdnet.conf /config/birdnet.conf; do
|
||||
if [ -f "$file" ]; then
|
||||
sed -i "/^REC_CARD/c\REC_CARD=$ALSA_CARD" "$file"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Fix timezone as per installer
|
||||
CURRENT_TIMEZONE="$(timedatectl show --value --property=Timezone)"
|
||||
[ -f /etc/timezone ] && echo "$CURRENT_TIMEZONE" | sudo tee /etc/timezone > /dev/null
|
||||
|
||||
Reference in New Issue
Block a user