diff --git a/Batterie/module.php b/Batterie/module.php index 9278c46..c83f7f1 100644 --- a/Batterie/module.php +++ b/Batterie/module.php @@ -140,11 +140,17 @@ public function RequestAction($Ident, $Value) $array_powersteps = $this->GeneratePowerSteps(); $aufdasnachladen = $this->ReadPropertyInteger("AufdasNachladen"); $minimumentladen = $this->ReadPropertyInteger("MinimumEntladen"); - $batterieladezustand = GetValue($this->ReadPropertyInteger("Batterieladezustand")); - $maxleistung = $this->ReadPropertyInteger("MaxBatterieleistung"); - + $batterieladezustandID = $this->ReadPropertyInteger("Batterieladezustand"); + if ($batterieladezustandID > 0) { + $batterieladezustand = GetValue($batterieladezustandID); + } else { + IPS_LogMessage("Batterie", "Fehler: Ungültige Batterieladezustand-ID."); + return; + } + + if ($Peak) { if ($batterieladezustand <= $minimumentladen) { $filtered_powersteps = array_filter($array_powersteps, function ($value) use ($maxleistung) { diff --git a/library.json b/library.json index 914ff9c..f8ea3f2 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "1.054", + "version": "1.055", "build": 0, "date": 0 } \ No newline at end of file