From 9f25f34398ec32f9328b76a43ef20fb11d396c5f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 20 Aug 2019 14:07:34 +0200 Subject: [PATCH 1/2] Add TEMPERATURELIMIT setting in setupVars.conf for setting the level beyond which we show the temperature icon in red on the dashboard. Signed-off-by: DL6ER --- scripts/pi-hole/php/header.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index e070bc81..ca94d496 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -60,6 +60,15 @@ { $temperatureunit = $_POST["tempunit"]; } + // Get user-defined temperature limit if set + if(isset($setupVars['TEMPERATURELIMIT'])) + { + $temperaturelimit = intval($setupVars['TEMPERATURELIMIT']); + } + else + { + $temperaturelimit = 60; + } } else { @@ -339,7 +348,7 @@ if($auth) { { if ($celsius >= -273.15) { echo " 60) { + if ($celsius > $temperaturelimit) { echo "#FF0000"; } else From 693a2f4e6010a408e970b19e4bcb6b699d3f204b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 21 Aug 2019 10:09:47 +0200 Subject: [PATCH 2/2] Change key: TEMPERATURELIMIT -> TEMPERATURE_LIMIT Signed-off-by: DL6ER --- scripts/pi-hole/php/header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index ca94d496..9ab0d721 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -61,9 +61,9 @@ $temperatureunit = $_POST["tempunit"]; } // Get user-defined temperature limit if set - if(isset($setupVars['TEMPERATURELIMIT'])) + if(isset($setupVars['TEMPERATURE_LIMIT'])) { - $temperaturelimit = intval($setupVars['TEMPERATURELIMIT']); + $temperaturelimit = intval($setupVars['TEMPERATURE_LIMIT']); } else {