diff --git a/Batterie/module.php b/Batterie/module.php index c83f7f1..804f90f 100644 --- a/Batterie/module.php +++ b/Batterie/module.php @@ -141,7 +141,7 @@ public function RequestAction($Ident, $Value) $aufdasnachladen = $this->ReadPropertyInteger("AufdasNachladen"); $minimumentladen = $this->ReadPropertyInteger("MinimumEntladen"); $maxleistung = $this->ReadPropertyInteger("MaxBatterieleistung"); - + $dummy_array = []; $batterieladezustandID = $this->ReadPropertyInteger("Batterieladezustand"); if ($batterieladezustandID > 0) { $batterieladezustand = GetValue($batterieladezustandID); @@ -172,14 +172,18 @@ public function RequestAction($Ident, $Value) } else { - $this->SetValue("PowerSteps", json_encode($array_powersteps[0])); + $dummy_array = $array_powersteps[0]; + + $this->SetValue("PowerSteps", json_encode($dummy_array)); } } else { // Solar + if ($batterieladezustand <= $minimumentladen) { - $this->SetValue("PowerSteps", max($array_powersteps)); + $dummy_array = max($array_powersteps); + $this->SetValue("PowerSteps", json_encode($dummy_array)); } else { $filtered_powersteps = array_filter($array_powersteps, function ($value) use ($maxleistung) { return $value >= 0; // Hochpass filtern diff --git a/library.json b/library.json index f8ea3f2..adffc63 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "1.055", + "version": "1.056", "build": 0, "date": 0 } \ No newline at end of file