Add Kelvin

This commit is contained in:
DL6ER
2016-12-20 12:17:59 +01:00
parent 64ac22944e
commit f5eaf6d140
3 changed files with 14 additions and 5 deletions
+8 -3
View File
@@ -22,6 +22,7 @@
if(is_numeric($output))
{
$celsius = intVal($output)*1e-3;
$kelvin = $celsius + 273.15;
$fahrenheit = ($celsius*9./5)+32.0;
if(isset($setupVars['TEMPERATUREUNIT']))
@@ -261,13 +262,17 @@
echo "#3366FF";
}
echo "\"></i> Temp:&nbsp;";
if($temperatureunit != "F")
if($temperatureunit === "F")
{
echo round($celsius,1) . "&deg;C";
echo round($fahrenheit,1) . "&deg;F";
}
elseif($temperatureunit === "K")
{
echo round($kelvin,1) . "K";
}
else
{
echo round($fahrenheit,1) . "&deg;F";
echo round($celsius,1) . "&deg;C";
}
echo "</a>";
}
+5 -2
View File
@@ -222,12 +222,14 @@ function validDomain($domain_name)
if($_POST["tempunit"] == "F")
{
exec('sudo pihole -a -f');
$success .= "The webUI settings have been updated";
}
elseif($_POST["tempunit"] == "K")
{
exec('sudo pihole -a -k');
}
else
{
exec('sudo pihole -a -c');
$success .= "The webUI settings have been updated";
}
if(isset($_POST["boxedlayout"]))
{
@@ -237,6 +239,7 @@ function validDomain($domain_name)
{
exec('sudo pihole -a layout traditional');
}
$success .= "The webUI settings have been updated";
break;
case "reboot":
+1
View File
@@ -452,6 +452,7 @@
<h4>CPU Temperature Unit</h4>
<div class="form-group">
<div class="radio"><label><input type="radio" name="tempunit" value="C" <?php if($temperatureunit === "C"){ ?>checked<?php } ?> >Celsius</label></div>
<div class="radio"><label><input type="radio" name="tempunit" value="K" <?php if($temperatureunit === "K"){ ?>checked<?php } ?> >Kelvin</label></div>
<div class="radio"><label><input type="radio" name="tempunit" value="F" <?php if($temperatureunit === "F"){ ?>checked<?php } ?> >Fahrenheit</label></div>
</div>
</div>