This commit is contained in:
Alexandre
2024-10-05 12:09:17 +02:00
committed by GitHub
parent f3f06dfe5c
commit a08c014f69
5 changed files with 8 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e
# Check if there are files in "$HOME"/BirdSongs/StreamData and move them to /data/StreamData
if [ -d /data/StreamData ] && [ "$(ls -A /data/StreamData/)" ]; then

View File

@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e
@@ -12,12 +12,12 @@ common_steps () {
sed -i "s|%%mqtt_port%%|$MQTT_PORT|g" /helpers/birdnet_to_mqtt.py
sed -i "s|%%mqtt_user%%|$MQTT_USER|g" /helpers/birdnet_to_mqtt.py
sed -i "s|%%mqtt_pass%%|$MQTT_PASS|g" /helpers/birdnet_to_mqtt.py
# Copy script to the appropriate directory
cp /helpers/birdnet_to_mqtt.py "$HOME"/BirdNET-Pi/scripts/utils/birdnet_to_mqtt.py
chown pi:pi "$HOME"/BirdNET-Pi/scripts/utils/birdnet_to_mqtt.py
chmod +x "$HOME"/BirdNET-Pi/scripts/utils/birdnet_to_mqtt.py
# Add hooks to the main analysis script
sed -i "/load_global_model, run_analysis/a from utils.birdnet_to_mqtt import automatic_mqtt_publish" "$HOME"/BirdNET-Pi/scripts/birdnet_analysis.py
sed -i '/write_to_db(/a\ automatic_mqtt_publish(file, detection, os.path.basename(detection.file_name_extr))' "$HOME"/BirdNET-Pi/scripts/birdnet_analysis.py

View File

@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e

View File

@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e