From 2cc763a5880b0e234d2149d746104fcb49858888 Mon Sep 17 00:00:00 2001 From: "belevo\\mh" Date: Wed, 27 May 2026 11:41:25 +0200 Subject: [PATCH] no message --- Peakshaving/form.json | 2 +- Peakshaving/module.php | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Peakshaving/form.json b/Peakshaving/form.json index ab95fea..b70d9e4 100644 --- a/Peakshaving/form.json +++ b/Peakshaving/form.json @@ -60,7 +60,7 @@ { "type": "Button", "caption": "Werte sofort übernehmen", - "onClick": "Peakshaving_ApplyCurrentValues($id);" + "onClick": "GEF_ApplyCurrentValues($id);" } ] } \ No newline at end of file diff --git a/Peakshaving/module.php b/Peakshaving/module.php index 57af6fd..b54249c 100644 --- a/Peakshaving/module.php +++ b/Peakshaving/module.php @@ -49,17 +49,16 @@ class Peakshaving extends IPSModule $this->RegisterTimer('DailyUpdate', 0, 'GEF_ApplyCurrentValues($_IPS[\'TARGET\']);'); } - public function ApplyChanges() - { - parent::ApplyChanges(); +public function ApplyChanges() +{ + parent::ApplyChanges(); - // täglich um 00:05 Uhr - $this->SetTimerInterval('DailyUpdate', 24 * 60 * 60 * 1000); + $this->SetTimerInterval('DailyUpdate', 24 * 60 * 60 * 1000); - // Beim Übernehmen der Modul-Konfiguration direkt aktuelle Werte setzen - $this->ApplyCurrentValues(); + if (IPS_GetName($this->InstanceID) == '') { + IPS_SetName($this->InstanceID, 'Peakshaving'); } - +} public function RequestAction($Ident, $Value) { switch ($Ident) { @@ -88,7 +87,7 @@ class Peakshaving extends IPSModule $this->ApplyCapacityToTarget($values['capacity']); $this->ApplyPowerToTarget($values['power']); - echo 'Peakshaving Werte wurden übernommen.' . PHP_EOL; + return 'Peakshaving Werte wurden übernommen.'; } private function GetValuesForCurrentMonth()