Skip to content

A live bird collage card for your Home Assistant dashboard.

Update overview.php

ehpersonal38c5c993cf6118
diff --git a/scripts/overview.php b/scripts/overview.php
index 86e14c28..e4347954 100644
--- a/scripts/overview.php
+++ b/scripts/overview.php
@@ -261,6 +261,10 @@ body::-webkit-scrollbar {
<div class="chart">
<?php
$refresh = $config['RECORDING_LENGTH'];
+$dividedrefresh = $refresh/4;
+if($dividedrefresh == 0) {
+ $dividedrefresh = 1;
+}
$time = time();
if (file_exists('./Charts/'.$chart)) {
echo "<img id='chart' src=\"/Charts/$chart?nocache=$time\">";
@@ -332,7 +336,7 @@ window.setInterval(function(){
// image or audio didn't load for some reason, force a refresh in 5 seconds
loadDetectionIfNewExists();
}
-}, <?php echo intval($refresh/4); ?>*1000);
+}, <?php echo intval($dividedrefresh); ?>*1000);
function loadFiveMostRecentDetections() {
const xhttp = new XMLHttpRequest();