From 32245188612bec317d5e56bd4abbfc88fbb80664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fliger?= Date: Fri, 14 Mar 2025 10:21:25 +0100 Subject: [PATCH] =?UTF-8?q?stepgr=C3=B6sse=20und=20berechnungsintervall=20?= =?UTF-8?q?ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Batterie/module.php | 12 +++++++++--- Manager/module.php | 2 +- library.json | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Batterie/module.php b/Batterie/module.php index 7f67889..a404ae9 100644 --- a/Batterie/module.php +++ b/Batterie/module.php @@ -44,7 +44,7 @@ class Batterie extends IPSModule // Initialisiere Idle $this->SetValue("Idle", true); - $this->RegisterTimer("Timer_Do_UserCalc",5000,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");'); + $this->RegisterTimer("Timer_Do_UserCalc",2500,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");'); } @@ -56,11 +56,11 @@ class Batterie extends IPSModule $batterieManagement = $this->ReadPropertyInteger("Batteriemanagement"); $this->SetValue("Batteriemanagement_Variabel", $batterieManagement); } - + private function GeneratePowerSteps($additionalValue) { $maxleistung = $this->ReadPropertyInteger("MaxBatterieleistung"); - $stepSize = 125; // Schrittgröße + $stepSize = 250; // Schrittgröße $stepSizeSmall = 25; // Kleine Schrittgröße // Array direkt als Range erzeugen (schneller als Schleife) @@ -79,11 +79,17 @@ class Batterie extends IPSModule // Zusätzliche Werte berechnen und auf MaxLeistung begrenzen $newValues = array_filter([ + $closestValue - 5 * $stepSizeSmall, + $closestValue - 4 * $stepSizeSmall, + $closestValue - 3 * $stepSizeSmall, $closestValue - 2 * $stepSizeSmall, $closestValue - $stepSizeSmall, $closestValue, $closestValue + $stepSizeSmall, $closestValue + 2 * $stepSizeSmall + $closestValue + 3 * $stepSizeSmall + $closestValue + 4 * $stepSizeSmall + $closestValue + 5 * $stepSizeSmall ], function ($value) use ($maxleistung) { return $value >= -$maxleistung && $value <= $maxleistung; }); diff --git a/Manager/module.php b/Manager/module.php index 61f1a68..93ae594 100644 --- a/Manager/module.php +++ b/Manager/module.php @@ -17,7 +17,7 @@ class Manager extends IPSModule $this->RegisterPropertyInteger("DatenZuruck", 0); // Initialisierung mit 0 // Timer registrieren - $this->RegisterTimer("Timer_DistributeEnergy",5000,"IPS_RequestAction(" .$this->InstanceID .', "DistributeEnergy", "");'); + $this->RegisterTimer("Timer_DistributeEnergy",3000,"IPS_RequestAction(" .$this->InstanceID .', "DistributeEnergy", "");'); } public function ApplyChanges() diff --git a/library.json b/library.json index a2dc0df..d702628 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "1.183", + "version": "1.184", "build": 0, "date": 0 } \ No newline at end of file