openhab-scripting 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4238eb3161f714b74aed518a4a3e6d02f2aeed634fc21d7276df152f8aeead8
|
4
|
+
data.tar.gz: 57666ad4b06970ea2859ab252a19b5801c34657025e11becb766ad2876157a1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4617faef054fc5f6e388314ff2ab46c1a80ad525fb576fb1d2d2a89bde37f5f420a3ca77000da6bf62546f8b3ab2ba77d24ab271c9ea2c232c02d547677ad61f
|
7
|
+
data.tar.gz: bf889c204885dc28b6416138d8cba0d116e8d3c408bfd2720b481f47820ea51bb5e067c1492df352db13e2e0267b4f647b48ed3d68591a5a8d444972640d6270
|
@@ -29,6 +29,7 @@ module OpenHAB
|
|
29
29
|
set_name(config.name)
|
30
30
|
set_description(config.description)
|
31
31
|
set_triggers(config.triggers)
|
32
|
+
@run_context = config.caller
|
32
33
|
@run_queue = config.run
|
33
34
|
@guard = config.guard
|
34
35
|
between = config.between&.yield_self { between(config.between) }
|
@@ -288,7 +289,7 @@ module OpenHAB
|
|
288
289
|
#
|
289
290
|
def process_otherwise_task(event, task)
|
290
291
|
logger.trace { "Executing rule '#{name}' otherwise block with event(#{event})" }
|
291
|
-
task.block
|
292
|
+
@run_context.instance_exec(event, &task.block)
|
292
293
|
end
|
293
294
|
|
294
295
|
#
|
@@ -316,7 +317,7 @@ module OpenHAB
|
|
316
317
|
return unless event&.item
|
317
318
|
|
318
319
|
logger.trace { "Executing rule '#{name}' trigger block with item (#{event.item})" }
|
319
|
-
|
320
|
+
@run_context.instance_exec(event.item, &task.block)
|
320
321
|
end
|
321
322
|
|
322
323
|
#
|
@@ -328,7 +329,7 @@ module OpenHAB
|
|
328
329
|
#
|
329
330
|
def process_run_task(event, task)
|
330
331
|
logger.trace { "Executing rule '#{name}' run block with event(#{event})" }
|
331
|
-
task.block
|
332
|
+
@run_context.instance_exec(event, &task.block)
|
332
333
|
end
|
333
334
|
|
334
335
|
#
|
@@ -23,10 +23,11 @@ module OpenHAB
|
|
23
23
|
def rule(rule_name, &block)
|
24
24
|
@rule_name = rule_name
|
25
25
|
config = RuleConfig.new(rule_name, block.binding)
|
26
|
-
config.
|
26
|
+
config.instance_exec(config, &block)
|
27
27
|
config.guard = Guard::Guard.new(only_if: config.only_if, not_if: config.not_if)
|
28
28
|
logger.trace { config.inspect }
|
29
29
|
process_rule_config(config)
|
30
|
+
config
|
30
31
|
rescue StandardError => e
|
31
32
|
re_raise_with_backtrace(e)
|
32
33
|
end
|
data/lib/openhab/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openhab-scripting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian O'Connell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|