diff -r 1302abe92eb1 -r e37b9c571a56 www-thermferm/liveview.php
--- a/www-thermferm/liveview.php Sat Jul 12 17:57:53 2014 +0200
+++ b/www-thermferm/liveview.php Sat Jul 12 19:22:13 2014 +0200
@@ -29,6 +29,7 @@
function showunit($unit)
{
$outstr = '';
+ $air_state = $beer_state = 1;
$sock = open_socket();
if ($sock == false) {
@@ -83,8 +84,25 @@
if (strcmp($vals[0], "MODE") == 0) {
$outstr .= ' mode ' . $vals[1] . '
' .PHP_EOL;
}
+ if (strcmp($vals[0], "AIR_STATE") == 0) {
+ $air_state = $vals[1];
+ }
+ if (strcmp($vals[0], "AIR_TEMPERATURE") == 0) {
+ if ($air_state == 0)
+ $outstr .= ' air temperature ' . $vals[1] . '
' .PHP_EOL;
+ else
+ $outstr .= ' air temperature N/A
' .PHP_EOL;
+ }
+ if (strcmp($vals[0], "BEER_STATE") == 0) {
+ $beer_state = $vals[1];
+ }
+ if (strcmp($vals[0], "BEER_TEMPERATURE") == 0) {
+ if ($beer_state == 0)
+ $outstr .= ' beer temperature ' . $vals[1] . '
' .PHP_EOL;
+ else
+ $outstr .= ' beer temperature N/A
' .PHP_EOL;
+ }
}
- $outstr .= ' temp 12.3'.PHP_EOL;
$outstr .= ' '.PHP_EOL;
$outstr .= ' '.PHP_EOL;
}