diff --git a/WP_Steuerung/module.php b/WP_Steuerung/module.php index 50eeb2d..1ed6711 100644 --- a/WP_Steuerung/module.php +++ b/WP_Steuerung/module.php @@ -206,5 +206,44 @@ class WP_Steurung extends IPSModule { } + + + // Methode zum Abrufen der aktuellen Daten + public function GetCurrentData(bool $Peak) { + + // tagessperrzeit berechnen + + + + $this->SetValue("LetzterPeakwert", $Peak); + + + if($this->GetValue("WP_Laufzeit_Zahler")<(20*12)){ + + $this->SetValue("PowerSteps", json_encode([$this->ReadPropertyInteger("CurrentPower")])); + + }else{ + + $this->SetValue("PowerSteps", json_encode([0, $this->ReadPropertyInteger("WP_Leistung")])); + + } + + } + + public function CheckIdle($power){ + $lastpower = GetValue($this->GetIDForIdent("CurrentPower")); + if($lastpower != $power){ + $this->SetValue("Idle", false); + $this->SetValue("IdleCounter", $this->ReadPropertyInteger("IdleCounterMax")); + } + // IdleCounter auslesen und verarbeiten + $idleCounter = $this->GetValue("IdleCounter"); + if ($idleCounter > 0) { + $this->SetValue("Idle", false); + $this->SetValue("IdleCounter", $idleCounter - 1); + } else { + $this->SetValue("Idle", true); + } + } } ?> \ No newline at end of file diff --git a/library.json b/library.json index 0580388..f191d22 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "0.105", + "version": "0.106", "build": 0, "date": 0 } \ No newline at end of file