From: RadOle <96960905+RadOle@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:24:32 +0000 (+0100) Subject: [mihome] Update README.md (#11926) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=1a2dcc65fb4f73051d431d2ff3ce7e48bbdc997f;p=openhab-addons.git [mihome] Update README.md (#11926) Following https://www.openhab.org/docs/configuration/rules-dsl.html#rule-examples one can find receivedEvent is now implicitly available in every rule that has a channel-based trigger --- diff --git a/bundles/org.openhab.binding.mihome/README.md b/bundles/org.openhab.binding.mihome/README.md index 25d10a7cb5..5a7e01f15e 100644 --- a/bundles/org.openhab.binding.mihome/README.md +++ b/bundles/org.openhab.binding.mihome/README.md @@ -246,8 +246,8 @@ rule "Mijia & Aqara Wireless Switch" when Channel "mihome:sensor_switch:::button" triggered then - var actionName = receivedEvent.getEvent() - switch(actionName) { + + switch(receivedEvent) { case "SHORT_PRESSED": { } @@ -267,8 +267,7 @@ rule "Mijia & Aqara Cube Controller" when Channel 'mihome:sensor_cube:::action' triggered then - var actionName = receivedEvent.getEvent() - switch(actionName) { + switch(receivedEvent) { case "MOVE": { } @@ -303,8 +302,7 @@ rule "Aqara Smart Motion Sensor" when Channel 'mihome:sensor_vibration:::action' triggered then - var actionName = receivedEvent.getEvent() - switch(actionName) { + switch(receivedEvent) { case "VIBRATE": { }