Refactoring Manager-User schnittstelle (Andere Variabelnnamen
This commit is contained in:
@@ -6,41 +6,37 @@ class Ladestation_Universal extends IPSModule
|
||||
{
|
||||
parent::Create();
|
||||
|
||||
// Prioritäten
|
||||
$this->RegisterVariableInteger("LockPrio", "LockPrio");
|
||||
$this->RegisterVariableInteger("UserPrio", "UserPrio");
|
||||
|
||||
// Energiehandling
|
||||
$this->RegisterVariableBoolean("Idle", "Idle", "", 0);
|
||||
$this->RegisterVariableInteger("CurrentPower", "CurrentPower", "", 0);
|
||||
$this->RegisterVariableFloat("UsedEnergy", "UsedEnergy", "", 0);
|
||||
$this->RegisterVariableString("PowerSteps", "PowerSteps"); // PowerSteps-Variable registrieren
|
||||
|
||||
// Trägheit
|
||||
$this->RegisterPropertyInteger("IdleCounterMax", 2);
|
||||
$this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0);
|
||||
$this->SetValue("IdleCounter", 0);
|
||||
|
||||
// Properties registrieren
|
||||
// Ladestationspezifische Properties
|
||||
$this->RegisterPropertyInteger("MinLeistung", 3600);
|
||||
$this->RegisterPropertyInteger("MaxLeistung", 11000);
|
||||
|
||||
$this->RegisterPropertyInteger("MinLeistung_1ph", 1400);
|
||||
$this->RegisterPropertyInteger("MaxLeistung_1ph", 7800);
|
||||
$this->RegisterPropertyString("IP_Adresse", "0.0.0.0");
|
||||
|
||||
// Ladestationspezifische Variabeln
|
||||
$this->RegisterVariableBoolean("Ladebereit", "Ladebereit", "~Switch", 1);
|
||||
$this->RegisterVariableBoolean("Solarladen", "Solarladen", "~Switch", 0);
|
||||
$this->RegisterVariableInteger("Fahrzeugstatus", "Fahrzeugstatus", "", 0);
|
||||
$this->RegisterVariableInteger("Lademodus", "Lademodus", "", 0);
|
||||
$this->RegisterVariableFloat("Ladeleistung_Effektiv", "Ladeleistung_Effektiv", "", 0);
|
||||
|
||||
$this->RegisterVariableBoolean("Peak", "Peak", "", 0);
|
||||
|
||||
$this->RegisterVariableInteger("Ladestrom", "Ladestrom");
|
||||
$this->RegisterVariableInteger("Ladeleistung", "Ladeleistung");
|
||||
|
||||
// Variabeln für Kommunkation mit Manager
|
||||
$this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio");
|
||||
$this->RegisterVariableInteger("PV_Prio", "PV_Prio");
|
||||
$this->RegisterVariableBoolean("Idle", "Idle", "", 0);
|
||||
$this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0);
|
||||
$this->RegisterVariableFloat("Bezogene_Energie", "Bezogene_Energie", "", 0);
|
||||
$this->RegisterVariableString("PowerSteps", "PowerSteps");
|
||||
|
||||
// Initialisieren
|
||||
// Hilfsvariabeln für Idle zustand
|
||||
$this->RegisterPropertyInteger("IdleCounterMax", 2);
|
||||
$this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0);
|
||||
$this->SetValue("IdleCounter", 0);
|
||||
|
||||
// Initialisiere Idle
|
||||
$this->SetValue("Idle", true);
|
||||
}
|
||||
|
||||
@@ -54,8 +50,8 @@ class Ladestation_Universal extends IPSModule
|
||||
public function RequestAction($Ident, $Value)
|
||||
{
|
||||
switch ($Ident) {
|
||||
case "SetCurrentPower":
|
||||
$this->SetCurrentPower($Value);
|
||||
case "SetAktuelle_Leistung":
|
||||
$this->SetAktuelle_Leistung($Value);
|
||||
break;
|
||||
case "GetCurrentData":
|
||||
$powerSteps = $this->GetCurrentData($Value);
|
||||
@@ -65,11 +61,11 @@ class Ladestation_Universal extends IPSModule
|
||||
}
|
||||
}
|
||||
|
||||
public function SetCurrentPower(int $power)
|
||||
public function SetAktuelle_Leistung(int $power)
|
||||
{
|
||||
$internalPower = GetValue($this->GetIDForIdent("CurrentPower"));
|
||||
$internalPower = GetValue($this->GetIDForIdent("Aktuelle_Leistung"));
|
||||
// Aktuelle Leistungsvorgabe setzen
|
||||
SetValue($this->GetIDForIdent("CurrentPower"), $power);
|
||||
SetValue($this->GetIDForIdent("Aktuelle_Leistung"), $power);
|
||||
if ($power != $internalPower) {
|
||||
// Setze die interne Leistungsvorgabe
|
||||
|
||||
@@ -124,7 +120,7 @@ class Ladestation_Universal extends IPSModule
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Ansonsten setze Ladeleistung auf die aktuelle Leistungsvorgabe (CurrentPower)
|
||||
// Ansonsten setze Ladeleistung auf die aktuelle Leistungsvorgabe (Aktuelle_Leistung)
|
||||
SetValue($this->GetIDForIdent("Ladeleistung"), $power);
|
||||
|
||||
if (GetValue($this->GetIDForIdent("Lademodus")) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user