A live bird collage card for your Home Assistant dashboard.
adding full species list editor
mcguirepr89eb218030e573
diff --git a/scripts/add_to_exclude.php b/scripts/add_to_exclude.phpnew file mode 100644index 00000000..6922eb28--- /dev/null+++ b/scripts/add_to_exclude.php@@ -0,0 +1,14 @@+<?php+error_reporting(E_ALL);+ini_set('display_errors',1);+$file='/home/pi/BirdNET-Pi/exclude_species_list.txt';+$str=file_get_contents("$file");+$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);+file_put_contents("$file", "$str");++if (isset($_POST['species']))+ foreach ($_POST['species'] as $selectedOption)+ file_put_contents("/home/pi/BirdNET-Pi/exclude_species_list.txt", $selectedOption."\n", FILE_APPEND);+header("Location: {$_SERVER['HTTP_REFERER']}");+exit;+?>diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.shindex 03816767..9ea86c82 100755--- a/scripts/birdnet_analysis.sh+++ b/scripts/birdnet_analysis.sh@@ -29,6 +29,12 @@ fiINCLUDE_LIST="/home/pi/BirdNET-Pi/include_species_list.txt"EXCLUDE_LIST="/home/pi/BirdNET-Pi/exclude_species_list.txt"+if [ "$(du ${INCLUDE_LIST} | awk '{print $1}')" -lt 4 ];then+ INCLUDE_LIST=null+fi+if [ "$(du ${EXCLUDE_LIST} | awk '{print $1}')" -lt 4 ];then+ EXCLUDE_LIST=null+fi# Create an array of the audio files# Takes one argument:diff --git a/scripts/del_from_exclude.php b/scripts/del_from_exclude.phpnew file mode 100644index 00000000..5fa7a485--- /dev/null+++ b/scripts/del_from_exclude.php@@ -0,0 +1,22 @@+<?php+error_reporting(E_ALL);+ini_set('display_errors',1);+$file='/home/pi/BirdNET-Pi/exclude_species_list.txt';+$str=file_get_contents("$file");+$str = preg_replace('/^\h*\v+/m', '', $str);+file_put_contents("$file", "$str");++if (isset($_POST['species']))+ foreach($_POST['species'] as $selectedOption) {+$content = file_get_contents("/home/pi/BirdNET-Pi/exclude_species_list.txt");+$newcontent = str_replace($selectedOption, "", "$content");+file_put_contents("/home/pi/BirdNET-Pi/exclude_species_list.txt", "$newcontent");+ }+$file='/home/pi/BirdNET-Pi/exclude_species_list.txt';+$str=file_get_contents("$file");+//$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);+$str = preg_replace('/^\h*\v+/m', '', $str);+file_put_contents("$file", "$str");+header("Location: {$_SERVER['HTTP_REFERER']}");+exit;+?>diff --git a/scripts/del_from_include.php b/scripts/del_from_include.phpindex 5f8d4414..219d88f4 100644--- a/scripts/del_from_include.php+++ b/scripts/del_from_include.php@@ -3,7 +3,7 @@ error_reporting(E_ALL);ini_set('display_errors',1);$file='/home/pi/BirdNET-Pi/include_species_list.txt';$str=file_get_contents("$file");-$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);+$str = preg_replace('/^\h*\v+/m', '', $str);file_put_contents("$file", "$str");if (isset($_POST['species']))@@ -12,6 +12,11 @@ $content = file_get_contents("/home/pi/BirdNET-Pi/include_species_list.txt");$newcontent = str_replace($selectedOption, "", "$content");file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", "$newcontent");}+$file='/home/pi/BirdNET-Pi/include_species_list.txt';+$str=file_get_contents("$file");+//$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);+$str = preg_replace('/^\h*\v+/m', '', $str);+file_put_contents("$file", "$str");header("Location: {$_SERVER['HTTP_REFERER']}");exit;?>diff --git a/scripts/exclude_list.php b/scripts/exclude_list.phpnew file mode 100644index 00000000..99e20fc9--- /dev/null+++ b/scripts/exclude_list.php@@ -0,0 +1,121 @@+<meta name="viewport" content="width=device-width, initial-scale=1">+<style>+* {+ font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',+ ' Calibri', 'Trebuchet MS', 'sans-serif';+ box-sizing: border-box;++ box-sizing: border-box;+}++/* Create two unequal columns that floats next to each other */+.column {+ float: left;+ padding: 10px;+}++.first {+ width: 45%;+}++.second {+ width: 10%;+ display: flex;+ justify-content: center;+ flex-direction: column;+ height: 100%;+}++.third {+ width: 45%;+}++/* Clear floats after the columns */+.row:after {+ content: "";+ display: table;+ clear: both;+}+body {+ background-color: rgb(119, 196, 135);+}++++a {+ text-decoration: none;+ color: white;+}++.block {+ display: block;+ font-weight: bold;+ width:100%;+ border: none;+ background-color: #04AA6D;+ padding: 20px 20px;+ color: white;+ font-size: medium;+ cursor: pointer;+ text-align: center;+}+h2 {+ text-align: center;+}+select {+ width:100%+}+@media screen and (max-width: 800px) {+ .column {+ float: none;+ width: 100%;+ }+}+</style>++<?php+//remove <script></script> and add php start and close tag+//comment these two lines when code started working fine+error_reporting(E_ALL);+ini_set('display_errors',1);++$filename = 'labels.txt';+$eachlines = file($filename, FILE_IGNORE_NEW_LINES);++?>++<body style="background-color: rgb(119, 196, 135);">+ <div class="row">+ <div class="column first">+ <h2>All Species Labels</h2>+ <form action="add_to_exclude.php" method="POST" id="add">+ <select name="species[]" id="species" multiple size="30">+ <option selected value="base">Please Select</option>+<?php+foreach($eachlines as $lines){+ echo "<option value='".$lines."'>$lines</option>";+}?>+ </select>+ </form>+ </div>++ <div class="column second">+ <button type="submit" form="add" class="block">Add to list</button><br>+ <button type="submit" form="del" class="block">Remove from list</button>+ </div>++ <div class="column third">+ <h2>Excluded Species List</h2>+ <form action="del_from_exclude.php" method="POST" id="del">+ <select name="species[]" id="value2" multiple size="30">+ <option selected value="base">Please Select</option>+<?php+ $filename = '/home/pi/BirdNET-Pi/exclude_species_list.txt';+$eachlines = file($filename, FILE_IGNORE_NEW_LINES);+foreach($eachlines as $lines){+ echo "<option value='".$lines."'>$lines</option>";+}?>+ </form>+ </div>+ </div>+</body>diff --git a/scripts/labels_list.php b/scripts/include_list.phpsimilarity index 100%rename from scripts/labels_list.phprename to scripts/include_list.phpdiff --git a/tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl b/tflite_runtime-2.6.0-cp37-none-linux_aarch64.whldeleted file mode 100644index 23019b9a..00000000Binary files a/tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl and /dev/null differ