Skip to content

Commit

Permalink
[rules] Adjust event object for recent core changes
Browse files Browse the repository at this point in the history
openhab/openhab-core#3141 changed the events
that are passed to the rule for **StateUpdateTriggers. This adds
support for the changed classnames whilst keeping backward
compatibility.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 committed Apr 5, 2023
1 parent bdd1b98 commit 362bb32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rules/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ const _getTriggeredData = function (input) {
data.eventType = 'change';
data.triggerType = 'ItemStateChangeTrigger';
break;
case 'org.openhab.core.items.events.ItemStateUpdatedEvent':
case 'org.openhab.core.items.events.GroupStateUpdatedEvent':
// **StateEvents replaced by **StateUpdatedEvents in https://github.com/openhab/openhab-core/pull/3141
case 'org.openhab.core.items.events.GroupItemStateEvent':
case 'org.openhab.core.items.events.ItemStateEvent':
data.itemName = event.getItemName();
Expand Down

0 comments on commit 362bb32

Please sign in to comment.