This commit is contained in:
2025-05-26 11:23:17 +02:00
parent b39b5e826f
commit aeb868ab11
+3 -8
View File
@@ -20,9 +20,7 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
$this->RegisterPropertyString("method", "Switch.Set");
$this->RegisterPropertyInteger("switch_bool", 0); // ID der Bool-Variable
// Beispiel-Variable zum Triggern der Aktion, damit RequestAction funktioniert
$this->RegisterVariableBoolean("Trigger", "Trigger MQTT", "~Switch");
$this->EnableAction("Trigger");
}
public function ApplyChanges()
@@ -36,15 +34,12 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
*/
public function RequestAction($Ident, $Value)
{
IPS_LogMessage("ShellySwitchSender", "RequestAction aufgerufen");
switch ($Ident) {
case "Trigger":
SetValue($this->GetIDForIdent("Trigger"), $Value);
case "GetAction":
$this->GetAction();
break;
default:
throw new Exception("Ungültige Aktion: $Ident");
throw new Exception("Invalid action");
}
}