From e6c4146b5d63cd1bb102d0abe28addebf4192e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fliger?= Date: Tue, 8 Apr 2025 06:57:53 +0200 Subject: [PATCH] no message --- Ladestation_v2/module.php | 70 ++++++++++++++++++++------------------- Manager_v2/module.php | 4 +-- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/Ladestation_v2/module.php b/Ladestation_v2/module.php index fd1fa73..8ca1a7d 100644 --- a/Ladestation_v2/module.php +++ b/Ladestation_v2/module.php @@ -61,6 +61,40 @@ class Ladestation_v2 extends IPSModule // Zusätzliche Anpassungen nach Bedarf } + + public function RequestAction($Ident, $Value) + { + switch ($Ident) { + + case "SetAktuelle_Leistung": + $this->SetValue("Power", (int)$Value); + break; + + case "GetCurrentData": + $this->SetValue("Is_Peak_Shaving", (bool)$Value); + break; + + case "Do_UserCalc": + + + if($this->Detect_Car($this->ReadPropertyInteger("Ladestation"))){ + $this->SetAktuelle_Leistung($this->GetValue("Power")); + $this->GetCurrentData($this->GetValue("Is_Peak_Shaving")); + } + else{ + SetValue($this->GetIDForIdent("PowerSteps"), json_encode([0])); + $this->SetValue("PowerSteps", json_encode([0])); + + + } + break; + + default: + throw new Exception("Invalid Ident"); + } + } + + public function Detect_Car(int $carType) { @@ -228,38 +262,6 @@ class Ladestation_v2 extends IPSModule - public function RequestAction($Ident, $Value) - { - switch ($Ident) { - - case "SetAktuelle_Leistung": - $this->SetValue("Power", (int)$Value); - break; - - case "GetCurrentData": - $this->SetValue("Is_Peak_Shaving", (bool)$Value); - break; - - case "Do_UserCalc": - - - if($this->Detect_Car($this->ReadPropertyInteger("Ladestation"))){ - $this->SetAktuelle_Leistung($this->GetValue("Power")); - $this->GetCurrentData($this->GetValue("Is_Peak_Shaving")); - } - else{ - SetValue($this->GetIDForIdent("PowerSteps"), json_encode([0])); - $this->SetValue("PowerSteps", json_encode([0])); - - - } - break; - - default: - throw new Exception("Invalid Ident"); - } - } - public function SetAktuelle_Leistung(int $power) { @@ -299,11 +301,11 @@ class Ladestation_v2 extends IPSModule } elseif (!$peak && !$solarladen) { // Wenn weder Peak noch Solarladen aktiv sind, setze Ladeleistung auf MaxLeistung - $this->sendPowerToStation(Get_Current_From_Power($this->GetValue("Is_1_ph"), $this->GetValue("Max_Current"))); + $this->sendPowerToStation($this->Get_Current_From_Power($this->GetValue("Is_1_ph"), $this->GetValue("Max_Current"))); } else { // Ansonsten setze Ladeleistung auf die aktuelle Leistungsvorgabe (Aktuelle_Leistung) - $this->sendPowerToStation(Get_Current_From_Power($this->GetValue("Is_1_ph"), $power)); + $this->sendPowerToStation($this->Get_Current_From_Power($this->GetValue("Is_1_ph"), $power)); } } diff --git a/Manager_v2/module.php b/Manager_v2/module.php index 445531a..6293d72 100644 --- a/Manager_v2/module.php +++ b/Manager_v2/module.php @@ -241,8 +241,8 @@ class Manager_v2 extends IPSModule $allSteps[] = [ "user" => $user["InstanceID"], "step" => $step - ]; - } + ];} + } else{ if($step<=0){ $allSteps[] = [