no message
This commit is contained in:
@@ -14,7 +14,7 @@ class SofarWechselrichter extends IPSModule
|
||||
{
|
||||
parent::Create();
|
||||
// Moduleigenschaften
|
||||
$this->RegisterPropertyString('IPAddress', '');
|
||||
$this->RegisterPropertyString('IPAddress', '172.31.70.80');
|
||||
$this->RegisterPropertyString('LoggerNumber', '0'); // als String
|
||||
$this->RegisterPropertyInteger('PollInterval', 60);
|
||||
$this->RegisterPropertyString('Registers', '[]'); // JSON-String
|
||||
@@ -60,15 +60,18 @@ class SofarWechselrichter extends IPSModule
|
||||
foreach ($registers as $entry) {
|
||||
$validIdents[] = 'Reg' . ((int)$entry['RegisterNumber']);
|
||||
}
|
||||
|
||||
$children = IPS_GetChildrenIDs($this->InstanceID);
|
||||
foreach ($children as $childID) {
|
||||
if (@IPS_VariableExists($childID)) {
|
||||
$info = IPS_GetVariable($childID);
|
||||
$ident = $info['VariableIdent'];
|
||||
if (substr($ident, 0, 3) === 'Reg') {
|
||||
if (!in_array($ident, $validIdents)) {
|
||||
IPS_DeleteVariable($childID);
|
||||
}
|
||||
// Nur Variablen berücksichtigen
|
||||
$obj = IPS_GetObject($childID);
|
||||
if ($obj['ObjectType'] !== 2) {
|
||||
continue;
|
||||
}
|
||||
$ident = $obj['ObjectIdent']; // VariableIdent
|
||||
if (substr($ident, 0, 3) === 'Reg') {
|
||||
if (!in_array($ident, $validIdents)) {
|
||||
IPS_DeleteVariable($childID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user