# HG changeset patch # User Michiel Broek # Date 1496240992 -7200 # Node ID fd1354e2a045424f4fd754ff531b2cd0ce04cc90 # Parent 2d1d43c3a2c2a733309a3917f15de5ff31c0632e Small web page changes diff -r 2d1d43c3a2c2 -r fd1354e2a045 www-thermferm/getalog.php --- a/www-thermferm/getalog.php Sun May 28 14:19:57 2017 +0200 +++ b/www-thermferm/getalog.php Wed May 31 16:29:52 2017 +0200 @@ -1,6 +1,6 @@ * @@ -39,10 +39,20 @@ if ($j > 1) $row .= ','; $f = explode(",", $arr[$j]); - $heater = $f[5] / 100; - $cooler = $f[6] / 100; - $row .= '{"Date":"'.$f[0].'","Mode":"'.$f[1].'","Air":"'.$f[2].'","Beer":"'.$f[3].'","Target_lo":"'.$f[4].'",'; - $row .= '"Heater":'.$heater.',"Cooler":'.$cooler.',"HeatUse":'.$f[7].',"CoolUse":"'.$f[8].'","Room":"'.$f[9].'","Target_hi":"'.$f[10].'"}'; + $reply = array ( + 'Date' => $f[0], + 'Mode' => $f[1], + 'Air' => $f[2], + 'Beer' => $f[3], + 'Target_lo' => $f[4], + 'Heater' => $f[5] / 100, + 'Cooler' => $f[6] / 100, + 'HeatUse' => $f[7], + 'CoolUse' => $f[8], + 'Room' => $f[9], + 'Target_hi' => $f[10] + ); + $row .= json_encode($reply, JSON_NUMERIC_CHECK); $j++; } } diff -r 2d1d43c3a2c2 -r fd1354e2a045 www-thermferm/getlog.php --- a/www-thermferm/getlog.php Sun May 28 14:19:57 2017 +0200 +++ b/www-thermferm/getlog.php Wed May 31 16:29:52 2017 +0200 @@ -1,6 +1,6 @@ * @@ -39,10 +39,20 @@ if ($j > 1) $row .= ','; $f = explode(",", $arr[$j]); - $heater = $f[5] / 100; - $cooler = $f[6] / 100; - $row .= '{"Date":"'.$f[0].'","Mode":"'.$f[1].'","Air":"'.$f[2].'","Beer":"'.$f[3].'","Target_lo":"'.$f[4].'",'; - $row .= '"Heater":'.$heater.',"Cooler":'.$cooler.',"HeatUse":'.$f[7].',"CoolUse":"'.$f[8].'","Room":"'.$f[9].'","Target_hi":"'.$f[10].'"}'; + $reply = array ( + 'Date' => $f[0], + 'Mode' => $f[1], + 'Air' => $f[2], + 'Beer' => $f[3], + 'Target_lo' => $f[4], + 'Heater' => $f[5] / 100, + 'Cooler' => $f[6] / 100, + 'HeatUse' => $f[7], + 'CoolUse' => $f[8], + 'Room' => $f[9], + 'Target_hi' => $f[10] + ); + $row .= json_encode($reply, JSON_NUMERIC_CHECK); $j++; } } diff -r 2d1d43c3a2c2 -r fd1354e2a045 www-thermferm/getroom.php --- a/www-thermferm/getroom.php Sun May 28 14:19:57 2017 +0200 +++ b/www-thermferm/getroom.php Wed May 31 16:29:52 2017 +0200 @@ -1,6 +1,6 @@ * @@ -42,11 +42,11 @@ if ($f[0] == "TEMP_STATE") $temp_state = $f[1]; if (($f[0] == "TEMP_VALUE") && ($temp_state == "OK")) - $temp_value = $f[1].' °C'; + $temp_value = $f[1]; if ($f[0] == "HUM_STATE") $hum_state = $f[1]; if (($f[0] == "HUM_VALUE") && ($hum_state == "OK")) - $hum_value = $f[1].' %'; + $hum_value = $f[1]; $j++; } } diff -r 2d1d43c3a2c2 -r fd1354e2a045 www-thermferm/index.php --- a/www-thermferm/index.php Sun May 28 14:19:57 2017 +0200 +++ b/www-thermferm/index.php Wed May 31 16:29:52 2017 +0200 @@ -1,6 +1,6 @@ * @@ -129,11 +129,11 @@ if ($f[0] == "TEMP_STATE") $temp_state = $f[1]; if (($f[0] == "TEMP_VALUE") && ($temp_state == "OK")) - $temp_value = $f[1].' °C'; + $temp_value = $f[1]; if ($f[0] == "HUM_STATE") $hum_state = $f[1]; if (($f[0] == "HUM_VALUE") && ($hum_state == "OK")) - $hum_value = $f[1].' %'; + $hum_value = $f[1]; $j++; } } @@ -167,8 +167,8 @@ $outstr .= ' ThermFerm '.$version.PHP_EOL; $outstr .= ' '.PHP_EOL; $outstr .= '
'.PHP_EOL; -$outstr .= '
'.$temp_value.'
'.PHP_EOL; -$outstr .= '
'.$hum_value.'
'.PHP_EOL; +$outstr .= '
'.$temp_value.' °C
'.PHP_EOL; +$outstr .= '
'.$hum_value.' %
'.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= ' '.PHP_EOL;