From fcff795137f82d1986f387267a7c439412b642b9 Mon Sep 17 00:00:00 2001 From: "belevo\\daniel" Date: Wed, 17 Jul 2024 14:51:59 +0200 Subject: [PATCH] 1-Phasenumschaltung funktioniert jetzt besser --- Ladestation_Universal/module.php | 44 +++++++++++++++++++++++++++----- library.json | 2 +- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/Ladestation_Universal/module.php b/Ladestation_Universal/module.php index 4465687..4a9235e 100644 --- a/Ladestation_Universal/module.php +++ b/Ladestation_Universal/module.php @@ -177,13 +177,13 @@ public function GetCurrentData(bool $Peak) { $powerSteps = [$maxLeistung]; } elseif (!$Peak && $solarladen) { - $powerSteps = array_merge($powerSteps, $this->getRangeLimits($minLeistung, $maxLeistung)); + $powerSteps = array_merge($powerSteps, $this->getRangeLimits($minLeistung, $maxLeistung, GetValue($this->GetIDForIdent("Lademodus")))); } elseif ($solarladen && $Peak) { $powerSteps = [0]; } else { - $powerSteps += $this->getRangeLimits($minLeistung, $maxLeistung); + $powerSteps += $this->getRangeLimits($minLeistung, $maxLeistung, GetValue($this->GetIDForIdent("Lademodus"))); } } @@ -254,7 +254,7 @@ public function sendPowerToStation($value) { public function convertPowerToCurrent($value, $Lademodus) { if($Lademodus==1){ - if ($value == 0) { + if ($value == 0) { return 0; } elseif ($value == 4150) { return 6; @@ -377,8 +377,9 @@ public function convertPowerToCurrent($value, $Lademodus) { } } -public function getRangeLimits($min, $max) { - $limits = [ +public function getRangeLimits($min, $max, $Lademodus) { + if($Lademodus==1){ + $limits = [ 4150, 4850, 5550, @@ -406,7 +407,38 @@ public function getRangeLimits($min, $max) { 20800, 21500, 22000 - ]; + ];} + elseif($Lademodus==0){ + $limits = [ + 1450, + 1690, + 1930, + 2170, + 2410, + 2650, + 2890, + 3130, + 3370, + 3610, + 3850, + 4090, + 4330, + 4570, + 4810, + 5050, + 5290, + 5530, + 5770, + 6010, + 6250, + 6490, + 6730, + 6970, + 7210, + 7450, + 7690 + ]; + } $result = []; diff --git a/library.json b/library.json index ea19238..0f95bfd 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "0.4", + "version": "0.5", "build": 0, "date": 0 } \ No newline at end of file