Skip to content

A live bird collage card for your Home Assistant dashboard.

warn user on every page if lon/lat aren't set

ehpersonal38712121e43234
diff --git a/homepage/views.php b/homepage/views.php
index b4d59a06..987f5227 100644
--- a/homepage/views.php
+++ b/homepage/views.php
@@ -50,6 +50,16 @@ if (file_exists('./scripts/thisrun.txt')) {
} elseif (file_exists('./scripts/firstrun.ini')) {
$config = parse_ini_file('./scripts/firstrun.ini');
}
+
+if ($config["LATITUDE"] == "0.000" && $config["LONGITUDE"] == "0.000") {
+ echo "<center style='color:red'><b>WARNING: Your latitude and longitude are not set properly. Please do so now in Tools -> Settings.</center></b>";
+}
+elseif ($config["LATITUDE"] == "0.000") {
+ echo "<center style='color:red'><b>WARNING: Your latitude is not set properly. Please do so now in Tools -> Settings.</center></b>";
+}
+elseif ($config["LONGITUDE"] == "0.000") {
+ echo "<center style='color:red'><b>WARNING: Your longitude is not set properly. Please do so now in Tools -> Settings.</center></b>";
+}
?>
<link rel="stylesheet" href="style.css?v=<?php echo date ('n.d.y', filemtime('style.css')); ?>">
<style>