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