# HG changeset patch # User Michiel Broek # Date 1405185733 -7200 # Node ID e37b9c571a56856790ed8193ed407fa9815e9731 # Parent 1302abe92eb165330dd3e2e81ea7c955390ec6e4 Units can display the temperature 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; }