# HG changeset patch # User Michiel Broek # Date 1407682582 -7200 # Node ID 934d45d9751d2a954d2c63374ba3c22bb3870fdb # Parent 8d2ba41265199d9c76f0cefc508a566199dbf89f Added room temperature and humidity to the web interface diff -r 8d2ba4126519 -r 934d45d9751d thermferm/server.c --- a/thermferm/server.c Sun Aug 10 16:17:03 2014 +0200 +++ b/thermferm/server.c Sun Aug 10 16:56:22 2014 +0200 @@ -452,10 +452,10 @@ srv_send((char *)"TEMPFORMAT,%c", Config.tempFormat); srv_send((char *)"TEMP_ADDRESS,%s", Config.temp_address); srv_send((char *)"TEMP_STATE,%s", TEMPSTATE[Config.temp_state]); - srv_send((char *)"TEMP_VALUE,%.3f", Config.temp_value / 1000.0); + srv_send((char *)"TEMP_VALUE,%.1f", Config.temp_value / 1000.0); srv_send((char *)"HUM_ADDRESS,%s", Config.hum_address); srv_send((char *)"HUM_STATE,%s", TEMPSTATE[Config.hum_state]); - srv_send((char *)"HUM_VALUE,%.3f", Config.hum_value / 1000.0); + srv_send((char *)"HUM_VALUE,%.0f", Config.hum_value / 1000.0); #ifdef HAVE_WIRINGPI_H srv_send((char *)"LCD_COLS,%d", Config.lcd_cols); srv_send((char *)"LCD_ROWS,%d", Config.lcd_rows); diff -r 8d2ba4126519 -r 934d45d9751d www-thermferm/css/style.css --- a/www-thermferm/css/style.css Sun Aug 10 16:17:03 2014 +0200 +++ b/www-thermferm/css/style.css Sun Aug 10 16:56:22 2014 +0200 @@ -46,6 +46,29 @@ font-weight: bold; } +#title { + width: 500px; + height: 50px; + float: left; +} + +#room { + width: 100px; + height: 48px; + float: left; + border-radius: 5px 5px 5px 5px; + background-color: #222; + text-align: center; + margin-top: 15px; +} + +.rtemp { + font-weight: bold; + font-size: 1.2em; + color: yellow; + margin-top: 3px; +} + #content { width: 978px; height: 428px; diff -r 8d2ba4126519 -r 934d45d9751d www-thermferm/getroom.php --- a/www-thermferm/getroom.php Sun Aug 10 16:17:03 2014 +0200 +++ b/www-thermferm/getroom.php Sun Aug 10 16:56:22 2014 +0200 @@ -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]; + $temp_value = $f[1].' °C'; 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 8d2ba4126519 -r 934d45d9751d www-thermferm/index.php --- a/www-thermferm/index.php Sun Aug 10 16:17:03 2014 +0200 +++ b/www-thermferm/index.php Sun Aug 10 16:56:22 2014 +0200 @@ -193,6 +193,9 @@ } +$temp_value = "NA"; +$hum_value = "NA"; + $outstr = ''.PHP_EOL; $outstr .= ''.PHP_EOL; $outstr .= ' '.PHP_EOL; @@ -216,6 +219,13 @@ $outstr .= ' '.PHP_EOL; $outstr .= '
'.PHP_EOL; $outstr .= '