diff --git a/includes/html/functions.inc.php b/includes/html/functions.inc.php index 5258def8ed..2485a199ef 100644 --- a/includes/html/functions.inc.php +++ b/includes/html/functions.inc.php @@ -1100,10 +1100,14 @@ function get_sensor_label_color($sensor, $type = 'sensors') return "" . trim($sensor['sensor_current']) . ''; } + if ($sensor['sensor_class'] == 'frequency' && $sensor['sensor_type'] == 'openwrt') { return "" . trim($sensor['sensor_current']) . ' ' . $unit . ''; } + if ($sensor['sensor_class'] == 'power_consumed') { + return "" . trim(Number::formatSi($sensor['sensor_current'] * 1000, 5, 5, 'Wh')) . ''; + } if (in_array($sensor['rrd_type'], ['COUNTER', 'DERIVE', 'DCOUNTER', 'DDERIVE'])) { //compute and display an approx rate for this sensor return "" . trim(Number::formatSi(max(0, $sensor['sensor_current'] - $sensor['sensor_prev']) / Config::get('rrd.step', 300), 2, 3, $unit)) . '';