From 93707c5de2e03e4e5dfbbdc785761db13d7b0f78 Mon Sep 17 00:00:00 2001 From: "belevo\\mh" Date: Mon, 24 Feb 2025 10:34:52 +0100 Subject: [PATCH] - --- Batterie/module.php | 12 +++++++++--- library.json | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) 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