openhab-scripting 2.11.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/openhab/core/dsl/rule/item.rb +1 -0
- data/lib/openhab/core/dsl/rule/rule.rb +18 -1
- data/lib/openhab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daa36a09bcefbd672716ede992f1525cf81edbf3db5bef1b40e46f7ab0a46837
|
4
|
+
data.tar.gz: 871e30faf15a2bd26010c5d118c26cbc569182bf7b849217b5b751148ec95fb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe9756bf909c3061d9824cf4a072ddd1e4c83ebdcec5710ebb166db4a9b302d06942bc3a10ab00a89acc28ab6db2c716a1adfd5cf39beee2462fbf253525bb84
|
7
|
+
data.tar.gz: '039eec961406e82062744e131aeb8da4db95dc613c9da0c017f0be70d77edae181f40bdbb49693b8b5244dbcabc9289470fb77eca2033f596285fcc5c0dc1a72'
|
@@ -303,6 +303,23 @@ module OpenHAB
|
|
303
303
|
false
|
304
304
|
end
|
305
305
|
|
306
|
+
#
|
307
|
+
# Patch event to include event.item when it doesn't exist
|
308
|
+
# This is to patch a bug see https://github.com/boc-tothefuture/openhab-jruby/issues/75
|
309
|
+
# It may be fixed in the openhab core in the future, in which case, this patch will no longer be necessary
|
310
|
+
#
|
311
|
+
# @param [OpenHAB Event] event to check for item accessor
|
312
|
+
# @param [OpenHAB Event Inputs] inputs inputs to running rule
|
313
|
+
#
|
314
|
+
def add_event_item(event, inputs)
|
315
|
+
return if event.nil? || defined?(event.item)
|
316
|
+
|
317
|
+
class << event
|
318
|
+
attr_accessor :item
|
319
|
+
end
|
320
|
+
event.item = inputs&.dig('triggeringItem')
|
321
|
+
end
|
322
|
+
|
306
323
|
#
|
307
324
|
# Process the run queue
|
308
325
|
#
|
@@ -317,7 +334,7 @@ module OpenHAB
|
|
317
334
|
when RuleConfig::Run
|
318
335
|
|
319
336
|
event = inputs&.dig('event')
|
320
|
-
|
337
|
+
add_event_item(event, inputs)
|
321
338
|
logger.trace { "Executing rule '#{name}' run block with event(#{event})" }
|
322
339
|
task.block.call(event)
|
323
340
|
when RuleConfig::Trigger
|
data/lib/openhab/version.rb
CHANGED