This commit is contained in:
Alexandre
2024-05-30 12:14:09 +02:00
parent 60e4fdbe15
commit efa56c179c
4 changed files with 22 additions and 33 deletions

View File

@@ -1,5 +1,6 @@
- Add weekly report button to views
- Use optional iframe for Adminer
- Enable species converter by default (only active if used)
## 0.13-46 (23-05-2024)
- Security : enable double layer basic auth with caddy in addition to php when connecting without ingress

View File

@@ -114,11 +114,11 @@ Example : https://www.amazon.fr/HUAREW-Valeurs-Ferrite-Suppresseur-Diam%C3%A8tre
### Microphone comparison
Recommended microphones ([full discussion here](https://github.com/mcguirepr89/BirdNET-Pi/discussions/39)):
Recommended microphones ([full discussion here](https://github.com/mcguirepr89/BirdNET-Pi/discussions/39)):
- Clippy EM272 (https://www.veldshop.nl/en/smart-clippy-em272z1-mono-omni-microphone.html) + ugreen aux to usb connector
- Boya By-LM40
Conclusion, using mic from Dahua is good enough, but Boya by-lm40 is more optimal for range as birndet model analysis the 150-15000Hz range
Conclusion, using mic from Dahua is good enough, EM272 is optimal, but Boya by-lm40 is a very good compromise as birndet model analysis the 150-15000Hz range
![image](https://github.com/alexbelgium/hassio-addons/assets/44178713/df992b79-7171-4f73-b0c0-55eb4256cd5b)

View File

@@ -94,7 +94,6 @@
"schema": {
"BIRDSONGS_FOLDER": "str?",
"BIRDS_ONLINE_INFO": "list(allaboutbirds.org|ebird.org)",
"SPECIES_CONVERTER": "bool?",
"TZ": "str?",
"certfile": "str",
"cifsdomain": "str?",
@@ -111,6 +110,6 @@
"udev": true,
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pi",
"usb": true,
"version": "0.13-46",
"version": "0.13-47",
"video": true
}

View File

@@ -10,6 +10,7 @@ echo " "
bashio::log.info "Adding new features"
# Set the online birds info system
##################################
if [[ "$(bashio::config "BIRDS_ONLINE_INFO")" == *"ebird"* ]]; then
echo "... using ebird instead of allaboutbirds"
# Set ebird database
@@ -36,26 +37,26 @@ else
sed -i "s|https://allaboutbirds.org/guide/\$comname|https://allaboutbirds.org/guide/\$comnameen|g" "$HOME"/BirdNET-Pi/scripts/stats.php
fi
# Add birds change option
if [ ! -f /home/pi/BirdNET-Pi/scripts/birdnet_changeidentification.sh ]; then
echo "... adding option to change detected birds"
# Clean previous files
rm /home/pi/BirdNET-Pi/scripts/play.php
rm /home/pi/BirdNET-Pi/homepage/style.css
# Download new files
curl -s -o /home/pi/BirdNET-Pi/homepage/images/bird.svg https://raw.githubusercontent.com/alexbelgium/BirdNET-Pi/patch-1/homepage/images/bird.svg
curl -s -o /home/pi/BirdNET-Pi/scripts/birdnet_changeidentification.sh https://raw.githubusercontent.com/alexbelgium/BirdNET-Pi/patch-1/scripts/birdnet_changeidentification.sh
curl -s -o /home/pi/BirdNET-Pi/scripts/play.php https://raw.githubusercontent.com/alexbelgium/BirdNET-Pi/patch-1/scripts/play.php
curl -s -o /home/pi/BirdNET-Pi/homepage/style.css https://raw.githubusercontent.com/alexbelgium/BirdNET-Pi/patch-1/homepage/style.css
# Correct permissions
chmod 777 /home/pi/BirdNET-Pi/scripts/birdnet_changeidentification.sh
chmod 777 /home/pi/BirdNET-Pi/scripts/play.php
chmod 777 /home/pi/BirdNET-Pi/homepage/style.css
# Convert Adminer to iframe
###############################
if ! grep "iframe src=\'scripts/adminer.php" "$HOME"/BirdNET-Pi/homepage/views.php; then
sed -i '/scripts\/adminer.php\\/c\ <button type=\\"submit\\" name=\\"view\\" value=\\"Adminer\\" form=\\"views\\">Database Maintenance</button>' "$HOME"/BirdNET-Pi/homepage/views.php
sed -i "/advanced.php/a\ if(\$_GET\['view'\] == \"Adminer\"){echo \"<iframe src='scripts/adminer.php'></iframe>\";}" "$HOME"/BirdNET-Pi/homepage/views.php
sed -i "s|deny|SameOrigin|g" "$HOME"/BirdNET-Pi/scripts/adminer.php
sed -i "1a echo '<a href=\"'.\$_SERVER\['PHP_SELF'\]\.'\" target=\"_blank\">Open in new page</a>';" "$HOME"/BirdNET-Pi/scripts/adminer.php
fi
# Add weekly report button
###############################
if ! grep -q "Weekly Report" "$HOME"/BirdNET-Pi/homepage/views.php; then
sed -i "67a\ <button type=\"submit\" name=\"view\" value=\"Weekly Report\" form=\"views\">Weekly Report</button>" "$HOME"/BirdNET-Pi/homepage/views.php
fi
# Add species conversion system
if bashio::config.true "SPECIES_CONVERTER"; then
bashio::log.yellow "... adding feature of SPECIES_CONVERTER, a new tab is added to your Tools"
###############################
if ! grep -q "Converted" "$HOME"/BirdNET-Pi/homepage/views.php; then
echo "... adding feature of SPECIES_CONVERTER, a new tab is added to your Tools"
touch /config/convert_species_list.txt
chown pi:pi /config/convert_species_list.txt
sudo -u pi ln -fs /config/convert_species_list.txt "$HOME"/BirdNET-Pi/
@@ -116,16 +117,4 @@ if bashio::config.true "SPECIES_CONVERTER"; then
fi
fi
# Convert Adminer to iframe
if ! grep "iframe src=\'scripts/adminer.php" "$HOME"/BirdNET-Pi/homepage/views.php; then
sed -i '/scripts\/adminer.php\/c\ <button type=\\"submit\\" name=\\"view\\" value=\\"Adminer\\" form=\\"views\\">Database Maintenance</button>' "$HOME"/BirdNET-Pi/homepage/views.php
#sed -i "/if\(\$_GET\['view'\] == \"Webterm\"\){/i test" "$HOME"/BirdNET-Pi/homepage/views.php
sed -i "s|deny|SameOrigin|g" "$HOME"/BirdNET-Pi/scripts/adminer.php
fi
# Add weekly report button
if ! grep -q "Weekly Report" "$HOME"/BirdNET-Pi/homepage/views.php; then
sed -i "67a\ <button type=\"submit\" name=\"view\" value=\"Weekly Report\" form=\"views\">Weekly Report</button>" "$HOME"/BirdNET-Pi/homepage/views.php
fi
echo " "