Mqtt überarbeitet
This commit is contained in:
@@ -223,18 +223,31 @@ class Shelly_Parser_MQTT extends IPSModule
|
||||
|
||||
foreach (IPS_GetChildrenIDs($folder) as $cid) {
|
||||
if (IPS_GetObject($cid)['ObjectIdent'] === $ident) {
|
||||
|
||||
// ---- Action wieder setzen, falls sie fehlt ----
|
||||
if (str_contains($ident, '_output_')) {
|
||||
IPS_SetVariableCustomAction($cid, $this->InstanceID);
|
||||
}
|
||||
|
||||
return $cid;
|
||||
}
|
||||
}
|
||||
|
||||
// Variable neu anlegen
|
||||
$vid = IPS_CreateVariable(0);
|
||||
IPS_SetName($vid, $name);
|
||||
IPS_SetIdent($vid, $ident);
|
||||
IPS_SetParent($vid, $folder);
|
||||
|
||||
// ---- HIER: Action für Output-Variablen setzen ----
|
||||
if (str_contains($ident, '_output_')) {
|
||||
IPS_SetVariableCustomAction($vid, $this->InstanceID);
|
||||
}
|
||||
|
||||
return $vid;
|
||||
}
|
||||
|
||||
|
||||
private function EnsureFloatVariable(string $deviceID, string $ident, string $name): int
|
||||
{
|
||||
$folder = $this->GetDeviceFolder($deviceID);
|
||||
|
||||
Reference in New Issue
Block a user