Skip to content

A live bird collage card for your Home Assistant dashboard.

Handle $flickrimage in test notification

ehpersonal38585d66643284
diff --git a/scripts/config.php b/scripts/config.php
index d95a9fc5..a4631c02 100644
--- a/scripts/config.php
+++ b/scripts/config.php
@@ -187,6 +187,11 @@ if(isset($_GET['sendtest']) && $_GET['sendtest'] == "true") {
$filename = "http://birdnetpi.local/"."?filename=".$filename;
}
+ $attach="";
+ if (strpos($body, '$flickrimage') !== false) {
+ $attach = "--attach https://live.staticflickr.com/7430/27545810581_8bfa8289a3_c.jpg";
+ }
+
$title = str_replace("\$sciname", $sciname, $title);
$title = str_replace("\$comname", $comname, $title);
$title = str_replace("\$confidence", $confidence, $title);
@@ -199,6 +204,7 @@ if(isset($_GET['sendtest']) && $_GET['sendtest'] == "true") {
$title = str_replace("\$cutoff", $cutoff, $title);
$title = str_replace("\$sens", $sens, $title);
$title = str_replace("\$overlap", $overlap, $title);
+ $title = str_replace("\$flickrimage", "", $title);
$body = str_replace("\$sciname", $sciname, $body);
$body = str_replace("\$comname", $comname, $body);
@@ -212,8 +218,9 @@ if(isset($_GET['sendtest']) && $_GET['sendtest'] == "true") {
$body = str_replace("\$cutoff", $cutoff, $body);
$body = str_replace("\$sens", $sens, $body);
$body = str_replace("\$overlap", $overlap, $body);
+ $body = str_replace("\$flickrimage", "", $body);
- echo "<pre class=\"bash\">".shell_exec($home."/BirdNET-Pi/birdnet/bin/apprise -vv -t '".$title."' -b '".$body."' ".$cf." ")."</pre>";
+ echo "<pre class=\"bash\">".shell_exec($home."/BirdNET-Pi/birdnet/bin/apprise -vv -t '".$title."' -b '".$body."' ".$attach." ".$cf." ")."</pre>";
die();
}