mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-09 18:31:48 +02:00
Merge branch 'alexbelgium:master' into master
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
## 0.5.5-8 (03-07-2024)
|
||||
- New option : set the audio clip directory from addon options
|
||||
|
||||
## 0.5.5-2 (25-06-2024)
|
||||
- Minor bugs fixed
|
||||
|
||||
## 0.5.5 (22-06-2024)
|
||||
- Update to latest version from tphakala/birdnet-go (changelog : https://github.com/tphakala/birdnet-go/releases)
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
],
|
||||
"name": "Birdnet-go",
|
||||
"options": {
|
||||
"BIRDSONGS_FOLDER": "/config/clips",
|
||||
"COMMAND": "realtime"
|
||||
},
|
||||
"panel_admin": false,
|
||||
@@ -93,6 +94,7 @@
|
||||
],
|
||||
"schema": {
|
||||
"ALSA_CARD": "int?",
|
||||
"BIRDSONGS_FOLDER": "str?",
|
||||
"COMMAND": "str",
|
||||
"TZ": "str?",
|
||||
"cifsdomain": "str?",
|
||||
@@ -108,5 +110,5 @@
|
||||
"slug": "birdnet-go",
|
||||
"udev": true,
|
||||
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-go",
|
||||
"version": "0.5.5-2"
|
||||
"version": "0.5.5-8"
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 40 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 38 KiB |
53
birdnet-go/rootfs/etc/cont-init.d/01-structure.sh
Executable file
53
birdnet-go/rootfs/etc/cont-init.d/01-structure.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
#################
|
||||
# Migrate files #
|
||||
#################
|
||||
if [ -f /data/birdnet.db ]; then
|
||||
bashio::log.warning "Moving db to /config"
|
||||
mv /data/birdnet.db /config
|
||||
fi
|
||||
|
||||
# Audio clips location
|
||||
birdsongsloc="$(bashio::config "BIRDSONGS_FOLDER")"
|
||||
birdsongsloc="${birdsongsloc:-/config/clips}"
|
||||
birdsongsloc="${birdsongsloc%/}"
|
||||
mkdir -p "$birdsongsloc"
|
||||
if [ -d /data/clips ]; then
|
||||
bashio::log.warning "Audio clips found in /data, moving to the new location"
|
||||
cp -rnf /data/clips/* "$birdsongsloc"/
|
||||
rm -r /data/clips
|
||||
fi
|
||||
|
||||
####################
|
||||
# Correct defaults #
|
||||
####################
|
||||
bashio::log.info "Correct config for defaults"
|
||||
|
||||
# Database location
|
||||
echo "... database location is /config/birdnet.db"
|
||||
for configloc in /config/config.yaml /internal/conf/config.yaml; do
|
||||
if [ -f "$configloc" ]; then
|
||||
sed -i "/path: birdnet.db/c\ path: /config/birdnet.db # path to sqlite database" "$configloc"
|
||||
sed -i "/path to sqlite database/c\ path: /config/birdnet.db # path to sqlite database" "$configloc"
|
||||
fi
|
||||
done
|
||||
|
||||
# Birdsongs location
|
||||
echo "... audio clips saved to $birdsongsloc"
|
||||
for configloc in /config/config.yaml /internal/conf/config.yaml; do
|
||||
if [ -f "$configloc" ]; then
|
||||
sed -i "/path: clips/c\ path: $birdsongsloc/ # path to audio clip export directory" "$configloc"
|
||||
sed -i "/audio clip export directory/c\ path: $birdsongsloc/ # path to audio clip export directory" "$configloc"
|
||||
fi
|
||||
done
|
||||
|
||||
# If default capture is set at 0%, increase it to 50%
|
||||
current_volume="$(amixer sget Capture | grep -oP '\[\d+%]' | tr -d '[]%' | head -1)" 2>/dev/null || true
|
||||
current_volume="${current_volume:-100}"
|
||||
if [[ "$current_volume" -eq 0 ]]; then
|
||||
amixer sset Capture 70%
|
||||
bashio::log.warning "Microphone was off, volume set to 70%."
|
||||
fi
|
||||
@@ -9,7 +9,8 @@ if bashio::services.available 'mysql'; then
|
||||
bashio::log.yellow "MariaDB addon is active on your system! If you want to use it instead of sqlite, here are the informations to encode :"
|
||||
bashio::log.blue "Database user : $(bashio::services "mysql" "username")"
|
||||
bashio::log.blue "Database password : $(bashio::services "mysql" "password")"
|
||||
bashio::log.blue "Database name : nextcloud"
|
||||
bashio::log.blue "Host-name : $(bashio::services "mysql" "host"):$(bashio::services "mysql" "port")"
|
||||
bashio::log.blue "Database name : birdnet"
|
||||
bashio::log.blue "Host-name : $(bashio::services "mysql" "host")"
|
||||
bashio::log.blue "Port : $(bashio::services "mysql" "port")"
|
||||
bashio::log.green "---"
|
||||
fi
|
||||
|
||||
0
birdnet-go/rootfs/etc/cont-init.d/33-mqtt.sh
Normal file → Executable file
0
birdnet-go/rootfs/etc/cont-init.d/33-mqtt.sh
Normal file → Executable file
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.9 KiB |
Reference in New Issue
Block a user