From a57535e5abc85fcf4677561326268e09d34f015a Mon Sep 17 00:00:00 2001 From: Heiko Wilknitz Date: Sun, 30 Oct 2022 10:40:57 +0100 Subject: [PATCH] Update v3.5.20221020 (fix warning) --- Abfall_IO/module.php | 6 ++---- Awido/module.php | 6 ++---- MyMuell/module.php | 6 ++---- libs/VariableHelper.php | 6 +++--- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Abfall_IO/module.php b/Abfall_IO/module.php index 4275b2a..3d92ec7 100644 --- a/Abfall_IO/module.php +++ b/Abfall_IO/module.php @@ -16,6 +16,7 @@ class Abfall_IO extends IPSModule use EventHelper; use DebugHelper; use ServiceHelper; + use VariableHelper; // Service Provider private const SERVICE_PROVIDER = 'abpio'; @@ -512,10 +513,7 @@ public function Update() // write data to variable foreach ($vars as $key => $var) { - $varId = @$this->GetIDForIdent($var['ident']); - if ($varId != 0) { - SetValueString($varId, $var['date']); - } + $this->SetValueString((string)$var['ident'], $var['date']); } // execute Script diff --git a/Awido/module.php b/Awido/module.php index 3c9be33..f1505ce 100644 --- a/Awido/module.php +++ b/Awido/module.php @@ -11,6 +11,7 @@ class Awido extends IPSModule use EventHelper; use DebugHelper; use ServiceHelper; + use VariableHelper; // Service Provider private const SERVICE_PROVIDER = 'awido'; @@ -257,11 +258,8 @@ public function Update() // write data to variable foreach ($array as $line) { if ($line['exist'] == true) { - $varId = @$this->GetIDForIdent($line['ident']); // falls haendich geloescht, dann eben nicht! - if ($varId != 0) { - SetValueString($varId, $line['value']); - } + $this->SetValueString((string)$line['ident'], $line['value']); } } diff --git a/MyMuell/module.php b/MyMuell/module.php index 10ea36f..c639b44 100644 --- a/MyMuell/module.php +++ b/MyMuell/module.php @@ -11,6 +11,7 @@ class MyMuell extends IPSModule use EventHelper; use DebugHelper; use ServiceHelper; + use VariableHelper; // Service Provider private const SERVICE_PROVIDER = 'mymde'; @@ -188,10 +189,7 @@ public function Update() // write data to variable foreach ($waste as $key => $var) { - $varId = @$this->GetIDForIdent($key); - if ($varId != 0) { - SetValueString($varId, date('d.m.Y', $var['date'])); - } + $this->SetValueString((string)$key, date('d.m.Y', $var['date'])); } // execute Script diff --git a/libs/VariableHelper.php b/libs/VariableHelper.php index 7eb8af3..5de352e 100644 --- a/libs/VariableHelper.php +++ b/libs/VariableHelper.php @@ -27,7 +27,7 @@ trait VariableHelper */ protected function SetValueBoolean(string $ident, bool $value) { - $id = $this->GetIDForIdent($ident); + $id = @$this->GetIDForIdent($ident); if ($id !== false) { SetValueBoolean($id, $value); } @@ -41,7 +41,7 @@ protected function SetValueBoolean(string $ident, bool $value) */ protected function SetValueString(string $ident, string $value) { - $id = $this->GetIDForIdent($ident); + $id = @$this->GetIDForIdent($ident); if ($id !== false) { SetValueString($id, $value); } @@ -55,7 +55,7 @@ protected function SetValueString(string $ident, string $value) */ protected function SetValueInteger(string $ident, int $value) { - $id = $this->GetIDForIdent($ident); + $id = @$this->GetIDForIdent($ident); if ($id !== false) { SetValueInteger($id, $value); }