From 9bf65d9b0255883f94ebb15bb7139a54ab77812d Mon Sep 17 00:00:00 2001 From: "belevo\\mh" Date: Mon, 24 Feb 2025 14:02:07 +0100 Subject: [PATCH] code vereinfacht --- Batterie/module.php | 15 +++------------ library.json | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Batterie/module.php b/Batterie/module.php index 58ebe85..fddb7b6 100644 --- a/Batterie/module.php +++ b/Batterie/module.php @@ -91,25 +91,16 @@ public function RequestAction($Ident, $Value) public function SetAktuelle_Leistung(int $power) { - /* + / if ($power >= 0){ SetValue($this->ReadPropertyFloat("Ladeleistung"), $power); SetValue($this->ReadPropertyFloat("Entladeleistung"),0); }else{ SetValue($this->ReadPropertyFloat("Entladeleistung"), abs($power)); SetValue($this->ReadPropertyFloat("Ladeleistung"), 0); - }*/ + } + - $ladeleistungID = $this->ReadPropertyInteger("Ladeleistung"); - $entladeleistungID = $this->ReadPropertyInteger("Entladeleistung"); - - if ($ladeleistungID > 0 && IPS_VariableExists($ladeleistungID)) { - SetValue($ladeleistungID, floatval($power)); - } - - if ($entladeleistungID > 0 && IPS_VariableExists($entladeleistungID)) { - SetValue($entladeleistungID, floatval(abs($power))); - } diff --git a/library.json b/library.json index 5c33753..04d2c62 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "1.064", + "version": "1.065", "build": 0, "date": 0 } \ No newline at end of file