From 9ddef5178969a3e3c1e5c01ddf94631e2052d877 Mon Sep 17 00:00:00 2001 From: jhartworks Date: Thu, 29 Oct 2026 12:26:51 +0100 Subject: [PATCH] Enhance Multialarmer: ensure LimitEn profile is created during initialization and apply changes --- Multialarmer/module.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Multialarmer/module.php b/Multialarmer/module.php index 06eb441..d9f0062 100644 --- a/Multialarmer/module.php +++ b/Multialarmer/module.php @@ -10,6 +10,7 @@ class Multialarmer extends IPSModule { parent::Create(); + $this->EnsureLimitEnProfile(); $this->RegisterProperties(); $this->RegisterRecipientVariables(); @@ -41,6 +42,8 @@ class Multialarmer extends IPSModule public function ApplyChanges() { + $this->EnsureLimitEnProfile(); + // Ensure that existing Multialarmer instances also receive the // recipient variables after the module update. $this->RegisterRecipientVariables(); @@ -136,6 +139,15 @@ class Multialarmer extends IPSModule $this->RegisterPropertyString('WhatsAppApiKey', ''); } + private function EnsureLimitEnProfile() + { + if (!IPS_VariableProfileExists('LimitEn')) { + IPS_CreateVariableProfile('LimitEn', 0); + IPS_SetVariableProfileAssociation('LimitEn', true, 'Ja', '', 0x00FF00); + IPS_SetVariableProfileAssociation('LimitEn', false, 'Nein', '', 0xFFFF00); + } + } + private function RegisterRecipientVariables() { $mailRecipientsWereMissing = !@$this->GetIDForIdent('MailRecipients');