added exception for consumption and SensorInterpreters

This commit is contained in:
Steffen Vogel 2011-03-01 23:49:38 +01:00
parent a790f0b50e
commit f8d22a321c

View file

@ -228,7 +228,11 @@ class JSON extends View {
$this->json['data']['min'] = $interpreter->getMin();
$this->json['data']['max'] = $interpreter->getMax();
$this->json['data']['average'] = View::formatNumber($interpreter->getAverage());
$this->json['data']['consumption'] = View::formatNumber($interpreter->getConsumption());
if ($interpreter instanceof Interpreter\MeterInterpreter) {
$this->json['data']['consumption'] = View::formatNumber($interpreter->getConsumption());
}
$this->json['data']['count'] = $interpreter->getTupleCount();
if (count($data) > 0) $this->json['data']['tuples'] = $data;
}