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