A live bird collage card for your Home Assistant dashboard.
Round confidence to 2 decimals
ehpersonal38470e5d142dd9
diff --git a/scripts/overview.php b/scripts/overview.phpindex cba8a9f9..9087ead9 100644--- a/scripts/overview.php+++ b/scripts/overview.php@@ -64,7 +64,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" && isse<input type="hidden" name="view" value="Species Stats"><button type="submit" name="species" value="<?php echo $mostrecent['Com_Name'];?>"><?php echo $mostrecent['Com_Name'];?></button></br><a href="https://wikipedia.org/wiki/<?php echo $sciname;?>" target="_blank"/><i><?php echo $mostrecent['Sci_Name'];?></i></a>- <br>Confidence: <?php echo $mostrecent['Confidence'];?><br>+ <br>Confidence: <?php echo round($mostrecent['Confidence'],2);?><br><video style="margin-top:10px" onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster="<?php echo $filename.".png";?>" preload="none" title="<?php echo $filename;?>"><source src="<?php echo $filename;?>"></video></td></form></tr>diff --git a/scripts/play.php b/scripts/play.phpindex ad869be8..f6f84f5c 100644--- a/scripts/play.php+++ b/scripts/play.php@@ -176,7 +176,7 @@ if(isset($_GET['species'])){$sciname = preg_replace('/ /', '_', $results['Sci_Name']);$sci_name = $results['Sci_Name'];$time = $results['Time'];- $confidence = $results['Confidence'];+ $confidence = round($results['Confidence'],2);echo "<tr><td class=\"relative\"><a target=\"_blank\" href=\"index.php?filename=".$results['File_Name']."\"><img class=\"copyimage\" width=25 src=\"images/copy.png\"></a>$date $time<br>$confidence<br><video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster=\"$filename.png\" preload=\"none\" title=\"$filename\"><source src=\"$filename\"></video></td>diff --git a/scripts/stats.php b/scripts/stats.phpindex 230a54ac..a1369469 100644--- a/scripts/stats.php+++ b/scripts/stats.php@@ -116,7 +116,7 @@ $filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name'];while($results=$result3->fetchArray(SQLITE3_ASSOC)){$count = $results['COUNT(*)'];- $maxconf = $results['MAX(Confidence)'];+ $maxconf = round($results['MAX(Confidence)'],2);$date = $results['Date'];$time = $results['Time'];$name = $results['Com_Name'];@@ -172,7 +172,7 @@ fwrite($excludefile, $txt);<input type="hidden" name="sort" value="<?php if(isset($_GET['sort'])){echo $_GET['sort'];}?>"><td class="relative"><a target="_blank" href="index.php?filename=<?php echo $results['File_Name']; ?>"><img class="copyimage" width=25 src="images/copy.png"></a><input type="hidden" name="view" value="Species Stats"><button type="submit" name="species" value="<?php echo $results['Com_Name'];?>"><?php echo $results['Com_Name'];?></button><br><b>Occurrences:</b> <?php echo $results['COUNT(*)'];?><br>- <b>Max Confidence:</b> <?php echo $results['MAX(Confidence)'];?><br>+ <b>Max Confidence:</b> <?php echo round($results['MAX(Confidence)'],2);?><br><b>Best Recording:</b> <?php echo $results['Date']." ".$results['Time'];?><br><video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster="<?php echo $filename.".png";?>" preload="none" title="<?php echo $filename;?>"><source src="<?php echo $filename;?>" type="audio/mp3"></video></td></tr><?phpdiff --git a/scripts/todays_detections.php b/scripts/todays_detections.phpindex 1b4db75b..16513321 100644--- a/scripts/todays_detections.php+++ b/scripts/todays_detections.php@@ -92,7 +92,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {<td class="relative"><a target="_blank" href="index.php?filename=<?php echo $todaytable['File_Name']; ?>"><img class="copyimage" width=25 src="images/copy.png"></a><?php echo $todaytable['Time'];?><br><b><a class="a2" href="https://allaboutbirds.org/guide/<?php echo $comname;?>" target="top"><?php echo $todaytable['Com_Name'];?></a></b><br><a class="a2" href="https://wikipedia.org/wiki/<?php echo $sciname;?>" target="top"><i><?php echo $todaytable['Sci_Name'];?></i></a><br>- <b>Confidence:</b> <?php echo $todaytable['Confidence'];?><br>+ <b>Confidence:</b> <?php echo round($todaytable['Confidence'],2);?><br><video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster="<?php echo $filename.".png";?>" preload="none" title="<?php echo $filename;?>"><source preload="none" src="<?php echo $filename;?>"></video></td><?php } else { //legacy mode ?>