ka
This commit is contained in:
@@ -20,9 +20,7 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
|
|||||||
$this->RegisterPropertyString("method", "Switch.Set");
|
$this->RegisterPropertyString("method", "Switch.Set");
|
||||||
$this->RegisterPropertyInteger("switch_bool", 0); // ID der Bool-Variable
|
$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()
|
public function ApplyChanges()
|
||||||
@@ -36,15 +34,12 @@ class Symcon_Publish_to_Shelly_MQTT extends IPSModule
|
|||||||
*/
|
*/
|
||||||
public function RequestAction($Ident, $Value)
|
public function RequestAction($Ident, $Value)
|
||||||
{
|
{
|
||||||
IPS_LogMessage("ShellySwitchSender", "RequestAction aufgerufen");
|
|
||||||
|
|
||||||
switch ($Ident) {
|
switch ($Ident) {
|
||||||
case "Trigger":
|
case "GetAction":
|
||||||
SetValue($this->GetIDForIdent("Trigger"), $Value);
|
|
||||||
$this->GetAction();
|
$this->GetAction();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("Ungültige Aktion: $Ident");
|
throw new Exception("Invalid action");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user