fix: add Projectname and ProjectIdPortal properties to module and form configuration

This commit is contained in:
jhartworks
2026-04-16 14:18:27 +02:00
parent ae77a3901e
commit 16cf2c8468
3 changed files with 15 additions and 3 deletions
+11
View File
@@ -12,6 +12,17 @@
"caption": "JSON-Datenquelle",
"validVariableTypes": [3]
},
{
"type": "Text",
"name": "Projectname",
"caption": "Projekt-Name"
},
{
"type": "NumberSpinner",
"name": "ProjectIdPortal",
"caption": "Project-ID (Portal)",
"digits": 0
},
{
"type": "NumberSpinner",
"name": "ProjectIdPortal",
+3 -2
View File
@@ -9,6 +9,7 @@ class CounterServer extends IPSModule
$this->RegisterPropertyInteger('Connector', 0);
$this->RegisterPropertyInteger('SourceJSON', 0);
$this->RegisterPropertyInteger('UpdateTime', 60);
$this->RegisterPropertyString('Projectname', 60);
$this->RegisterPropertyInteger('ProjectIdPortal', -1);
$this->RegisterTimer('Update', 0, 'SECT_checkTable($_IPS[\'TARGET\']);');
}
@@ -49,7 +50,7 @@ class CounterServer extends IPSModule
$clientId = (string)$this->InstanceID;
$clientName = IPS_GetName($this->InstanceID);
$projectName = $this->ReadPropertyString('Projectname');
$timestamp = $payload['timestamp'] ?? date('Y-m-d H:i:s');
$counters = $payload['counters'] ?? [];
$projectId = $this->ReadPropertyInteger('ProjectIdPortal');
@@ -75,7 +76,7 @@ class CounterServer extends IPSModule
'" . $this->esc($counterId) . "',
'" . hash('sha256', $projectId.$clientId . '_' . $counterId) . "',
'" . $this->esc($clientId) . "',
'" . $this->esc($clientName) . "',
'" . $this->esc($projectName.'_'. $counterId) . "',
'" . $this->esc($type) . "',
'" . $this->esc($unit) . "',
1