fix: add Projectname and ProjectIdPortal properties to module and form configuration
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -8,6 +8,6 @@
|
||||
"date": 1491343200
|
||||
},
|
||||
"version": "1.1",
|
||||
"build": 0,
|
||||
"build": 2,
|
||||
"date": 0
|
||||
}
|
||||
Reference in New Issue
Block a user