From a5d5b7b7a79076fa5556311541bcefd00ab8ed0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fliger?= Date: Fri, 8 Nov 2024 15:51:56 +0100 Subject: [PATCH] =?UTF-8?q?weiterer=20teil=20zu=20testzwecken=20zugef?= =?UTF-8?q?=C3=BChgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WP_Steuerung/module.php | 53 +++++++++++++++++++++++++++++++++++++++++ library.json | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/WP_Steuerung/module.php b/WP_Steuerung/module.php index edc97dd..91a940e 100644 --- a/WP_Steuerung/module.php +++ b/WP_Steuerung/module.php @@ -5,10 +5,63 @@ class WP_Steurung extends IPSModule { public function Create() { parent::Create(); + // Prioritäten + $this->RegisterVariableInteger("LockPrio", "LockPrio"); + $this->RegisterVariableInteger("UserPrio", "UserPrio"); + + // Energiehandling + $this->RegisterVariableBoolean("Idle", "Idle", "", true); + $this->RegisterVariableInteger("CurrentPower", "CurrentPower", "", 0); + $this->RegisterVariableFloat("UsedEnergy", "UsedEnergy", "", 0); + $this->RegisterVariableString("PowerSteps", "PowerSteps"); // PowerSteps-Variable registrieren + + // Trägheit + $this->RegisterPropertyInteger("IdleCounterMax", 4); + $this->RegisterVariableInteger("IdleCounter", "IdleCounter", "", 0); + $this->SetValue("IdleCounter", 0); + + $this->RegisterVariableInteger("Mindestlaufzeit", "IdleCounter", "", 0); + + $this->RegisterVariableInteger("Zustand_WP", "Zustand_WP", "", 0); + + $this->RegisterVariableInteger("WP_Laufzeit_Zahler", "WP_Laufzeit_Zahler", "", 20*12); + $this->RegisterVariableBoolean("LetzterPeakwert", "LetzterPeakwert", "", false); + + + + + $this->RegisterPropertyInteger("WP_Leistung", 6000); + $this->RegisterPropertyInteger("Wolkenschwellwert", 60); + $this->RegisterPropertyInteger("Wolkenwert", 0); + $this->RegisterPropertyInteger("Aussentemperatur", 0); + $this->RegisterPropertyInteger("Referenzzeit", 0); + $this->RegisterPropertyInteger("Sperrkontakt", 0); + $this->RegisterPropertyInteger("Kontakt_Erhoeung", 0); + + //Initialisieren + $this->SetValue("Idle", true); } public function ApplyChanges() { parent::ApplyChanges(); } + + // Aktionen verarbeiten + public function RequestAction($Ident, $Value) { + switch ($Ident) { + case "SetCurrentPower": + $this->SetCurrentPower($Value); + break; + case "GetCurrentData": + return $this->GetCurrentData($Value); + break; + case "ResetPowerSteps": + $this->ResetPowerSteps($Value); + break; + default: + throw new Exception("Invalid Ident"); + } + } + } ?> \ No newline at end of file diff --git a/library.json b/library.json index a0a1b4e..e3a7ce0 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "0.101", + "version": "0.102", "build": 0, "date": 0 } \ No newline at end of file