]> git.basschouten.com Git - openhab-addons.git/commitdiff
[xmppclient] Update examples rules for OH3 usage (#9643)
authors0-er-eN <35891472+s0-er-eN@users.noreply.github.com>
Wed, 6 Jan 2021 20:46:25 +0000 (21:46 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Jan 2021 20:46:25 +0000 (21:46 +0100)
- Rename parameter 1 of "getActions" from "xmpp" to "xmppclient".
- Remove "getEvent()" as "receivedEvent" automatically contains the String since OH3.

bundles/org.openhab.binding.xmppclient/README.md

index dfe3a429f20558ac88218b06a5a64a32d09e3fa7..cbcf3535d6b87b3307965cccc923386132901a74 100644 (file)
@@ -53,7 +53,7 @@ when
     Item Xi_Leak changed
 then
     if(Xi_Leak.state == ON) {
-        val actions = getActions("xmpp","xmppclient:xmppBridge:xmpp")
+        val actions = getActions("xmppclient","xmppclient:xmppBridge:xmpp")
         actions.publishXMPP("pavel@example.com","Warning! Leak detected!")
     }
 end
@@ -66,7 +66,7 @@ rule "Turn off all lights without separator"
 when
     Channel "xmppclient:xmppBridge:xmpp:xmpp_command" triggered
 then
-    var actionName = receivedEvent.getEvent()
+    var actionName = receivedEvent
     if(actionName.toLowerCase() == "turn off lights") {
         Group_Light_Home_All.sendCommand(OFF)
     }
@@ -76,11 +76,11 @@ rule "Turn off all lights with separator and reply"
 when
     Channel "xmppclient:xmppBridge:xmpp:xmpp_command" triggered
 then
-    var actionName = receivedEvent.getEvent().split("##")
+    var actionName = receivedEvent.split("##")
     if(actionName.get(1).toLowerCase() == "turn off lights") {
         Group_Light_Home_All.sendCommand(OFF)
 
-        val actions = getActions("xmpp","xmppclient:xmppBridge:xmpp")
+        val actions = getActions("xmppclient","xmppclient:xmppBridge:xmpp")
         actions.publishXMPP(actionName.get(0),"All lights was turned off")
     }
 end