Skip to content

A live bird collage card for your Home Assistant dashboard.

use variables in title, too

mcguirepr89176c58aa1486
diff --git a/scripts/config.php b/scripts/config.php
index 2fe8e922..26cc594e 100644
--- a/scripts/config.php
+++ b/scripts/config.php
@@ -165,7 +165,7 @@ tgram://{bot_token}/{chat_id}
twitter://{ConsumerKey}/{ConsumerSecret}/{AccessToken}/{AccessSecret}
https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}
..." style="vertical-align: top" name="apprise_input" cols="140" rows="5" type="text" ><?php print($apprise_config);?></textarea><br><br>
- <label for="apprise_notification_title">Notification Title: </label>
+ <label for="apprise_notification_title">Notification Title (use variables $sciname, $comname, $confidence, or $listenurl): </label>
<input name="apprise_notification_title" type="text" value="<?php print($config['APPRISE_NOTIFICATION_TITLE']);?>" /><br>
<label for="apprise_notification_body">Notification Body (use variables $sciname, $comname, $confidence, or $listenurl): </label>
<input name="apprise_notification_body" type="text" value="<?php print($config['APPRISE_NOTIFICATION_BODY']);?>" /><br>
diff --git a/scripts/server.py b/scripts/server.py
index 8c3a2616..c9c6ac18 100755
--- a/scripts/server.py
+++ b/scripts/server.py
@@ -253,7 +253,7 @@ def sendAppriseNotifications(species, confidence, path):
apobj.notify(
body=body.replace("$sciname", species.split("_")[0]).replace("$comname", species.split("_")[1]).replace("$confidence", confidence).replace("$listenurl", listenurl),
- title=title,
+ title=title.replace("$sciname", species.split("_")[0]).replace("$comname", species.split("_")[1]).replace("$confidence", confidence).replace("$listenurl", listenurl),
)
if str(str(str([i for i in this_run if i.startswith('APPRISE_NOTIFY_NEW_SPECIES')]).split('=')[1]).split('\\')[0]) == "1":
@@ -272,7 +272,7 @@ def sendAppriseNotifications(species, confidence, path):
apobj.add(config)
apobj.notify(
body=body.replace("$sciname", species.split("_")[0]).replace("$comname", species.split("_")[1]).replace("$confidence", confidence).replace("$listenurl", listenurl) + " (only seen "+str(int(numberDetections)+1)+" times in last 7d)",
- title=title,
+ title=title.replace("$sciname", species.split("_")[0]).replace("$comname", species.split("_")[1]).replace("$confidence", confidence).replace("$listenurl", listenurl) + " (only seen "+str(int(numberDetections)+1)+" times in last 7d)",
)
con.close()