V1.0 Stable

This commit is contained in:
2025-01-22 11:12:05 +01:00
parent 7856853146
commit 05be791fde
8 changed files with 137 additions and 74 deletions

View File

@@ -36,6 +36,8 @@ class Ladestation_Universal extends IPSModule
$this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0);
$this->RegisterVariableFloat("Bezogene_Energie", "Bezogene_Energie", "", 0);
$this->RegisterVariableString("PowerSteps", "PowerSteps");
$this->RegisterVariableInteger("Power", "Power");
$this->RegisterVariableBoolean("Is_Peak_Shaving", "Is_Peak_Shaving");
// Hilfsvariabeln für Idle zustand
$this->RegisterPropertyInteger("IdleCounterMax", 2);
@@ -44,6 +46,9 @@ class Ladestation_Universal extends IPSModule
// Initialisiere Idle
$this->SetValue("Idle", true);
$this->RegisterTimer("Timer_Do_UserCalc",5000,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");');
}
public function ApplyChanges()
@@ -52,16 +57,24 @@ class Ladestation_Universal extends IPSModule
// Zusätzliche Anpassungen nach Bedarf
}
// Aktionen verarbeiten
public function RequestAction($Ident, $Value)
{
switch ($Ident) {
case "SetAktuelle_Leistung":
$this->SetAktuelle_Leistung($Value);
$this->SetValue("Power", (int)$Value);
break;
case "GetCurrentData":
$powerSteps = $this->GetCurrentData($Value);
return $powerSteps;
$this->SetValue("Is_Peak_Shaving", (bool)$Value);
break;
case "Do_UserCalc":
$this->SetAktuelle_Leistung($this->GetValue("Power"));
$this->GetCurrentData($this->GetValue("Is_Peak_Shaving"));
break;
default:
throw new Exception("Invalid Ident");
}