Commit 18686229 authored by Thomas Eimers's avatar Thomas Eimers

fix diagramms

parent 2a28b33c
Pipeline #96292352 failed with stages
in 17 minutes and 18 seconds
......@@ -46,7 +46,6 @@ class RrdService
public function getImageCommand(DateTimeInterface $date, State ...$sensorValues): string
{
$sensorValues = $this->filterSensors(...array_values($sensorValues));
if (empty($sensorValues)) {
throw new HeatingException('No Sensorvalues to show');
}
......@@ -90,13 +89,13 @@ class RrdService
{
$cmd = 'rrdtool graph /home/pi/heating-control/backend/public/images/temp-week.svg -a SVG --title="Temperatur 8 Tage ' . $date->format('d.m.Y G:i') . '" --start -' . (60 * 60 * 24 * 8) . ' --vertical-label "Grad Celsius" ';
$sensorValues = $this->filterSensors($sensorValues);
$sensorValues = $this->filterSensors(...$sensorValues);
$cmd .= $this->getLines(...$sensorValues);
return $cmd . '--font WATERMARK:0.1:DejaVuSansMono --font UNIT:0:DejaVuSansMono --font AXIS:6:DejaVuSansMono --font LEGEND:8:. -w 1000 -h350 --full-size-mode -E';
}
private function filterSensors($sensorValues)
private function filterSensors(State ...$sensorValues)
{
foreach ($sensorValues as $key => $sensorValue) {
if (in_array($sensorValue->getName(), $this->appConfig['diagrammWeekly']['skipSensors'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment