From 73d2ba5b48f3de20512585110a1cdfadc8afe65a Mon Sep 17 00:00:00 2001 From: Emmo213 Date: Mon, 5 Aug 2024 15:38:33 -0400 Subject: [PATCH] Dark daily chart (#152) * Updated daily chart to use the theme selector * Added sleep after changing theme so the chart can update * Added code for pink theme, made it easier to add more themes in the future * Added blue chart for future blue theme * Set chart background to none so it's transparent * Added back background for dark mode. * Change daily chart based on file based settings. Only support light/dark mode. * Cleanup * Added borders around the bars on the bar chart * Updated background color for dark theme * Merge from main * Fixed some spacing * Updating Python version for linting * Cleanup * Back leveled to Python 3.9 * Update scripts/daily_plot.py Co-authored-by: Nachtzuster * Coding suggestions --------- Co-authored-by: Nachtzuster --- scripts/config.php | 6 +++++- scripts/daily_plot.py | 33 ++++++++++++++++++++++++------ scripts/update_birdnet_snippets.sh | 1 + 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/scripts/config.php b/scripts/config.php index 104b481..78a8823 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -147,7 +147,6 @@ if(isset($_GET["latitude"])){ } } - $contents = file_get_contents("/etc/birdnet/birdnet.conf"); $contents = preg_replace("/SITE_NAME=.*/", "SITE_NAME=\"$site_name\"", $contents); $contents = preg_replace("/LATITUDE=.*/", "LATITUDE=$latitude", $contents); @@ -176,6 +175,10 @@ if(isset($_GET["latitude"])){ function() { window.parent.document.location.reload(); }, 1000);"; + + shell_exec("sudo systemctl restart chart_viewer.service"); + // the sleep allows for the service to restart and image to be generated + sleep(5); } $fh = fopen("/etc/birdnet/birdnet.conf", "w"); @@ -649,6 +652,7 @@ https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}

Color scheme

+ Note: when changing themes the daily chart may need a page refresh before updating.