[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
This commit is contained in:
parent
6da183495d
commit
1a2dcc65fb
@ -246,8 +246,8 @@ rule "Mijia & Aqara Wireless Switch"
|
|||||||
when
|
when
|
||||||
Channel "mihome:sensor_switch:<GwID>:<ID>:button" triggered
|
Channel "mihome:sensor_switch:<GwID>:<ID>:button" triggered
|
||||||
then
|
then
|
||||||
var actionName = receivedEvent.getEvent()
|
|
||||||
switch(actionName) {
|
switch(receivedEvent) {
|
||||||
case "SHORT_PRESSED": {
|
case "SHORT_PRESSED": {
|
||||||
<ACTION>
|
<ACTION>
|
||||||
}
|
}
|
||||||
@ -267,8 +267,7 @@ rule "Mijia & Aqara Cube Controller"
|
|||||||
when
|
when
|
||||||
Channel 'mihome:sensor_cube:<GwID>:<ID>:action' triggered
|
Channel 'mihome:sensor_cube:<GwID>:<ID>:action' triggered
|
||||||
then
|
then
|
||||||
var actionName = receivedEvent.getEvent()
|
switch(receivedEvent) {
|
||||||
switch(actionName) {
|
|
||||||
case "MOVE": {
|
case "MOVE": {
|
||||||
<ACTION>
|
<ACTION>
|
||||||
}
|
}
|
||||||
@ -303,8 +302,7 @@ rule "Aqara Smart Motion Sensor"
|
|||||||
when
|
when
|
||||||
Channel 'mihome:sensor_vibration:<GwID>:<ID>:action' triggered
|
Channel 'mihome:sensor_vibration:<GwID>:<ID>:action' triggered
|
||||||
then
|
then
|
||||||
var actionName = receivedEvent.getEvent()
|
switch(receivedEvent) {
|
||||||
switch(actionName) {
|
|
||||||
case "VIBRATE": {
|
case "VIBRATE": {
|
||||||
<ACTION>
|
<ACTION>
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user