openhab-scripting 2.13.1 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openhab/core/dsl/rule/item.rb +0 -5
- data/lib/openhab/core/dsl/rule/rule.rb +13 -0
- data/lib/openhab/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 376e7ceca67ad5ca1dfedcacee9096e97819f3a382404ddde4f7beb579416e7d
|
4
|
+
data.tar.gz: bdffa11dab63e1910d38a1232c38e2b9d64deaac1d8ea3610de464792d75173e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 712aa971a831d8b700ecbe23b429a083518deb3bf7c2b68aa91cc0f3e5253ac9a32087025994705b94d268db58ef73e27767dcb3ce182e4477bfa115c6c476e0
|
7
|
+
data.tar.gz: e450d32857df9dd5aea47cc5e0baa7043e06901282324d2dfd4623cb2eac03c8fb60335e3de2e680911f1d4ad24095c2533fd3a9d5c90501694f849019e2d225
|
@@ -35,9 +35,6 @@ module OpenHAB
|
|
35
35
|
# @return [Array] Array of current TriggerDelay objects
|
36
36
|
#
|
37
37
|
def changed_wait(item, duration:, to: nil, from: nil)
|
38
|
-
# Convert to testing the group if group specified rather than item
|
39
|
-
item = item.group if item.is_a? Group
|
40
|
-
|
41
38
|
# If GroupItems specified, use the group state trigger instead
|
42
39
|
if item.is_a? GroupItems
|
43
40
|
config = { 'groupName' => item.group.name }
|
@@ -97,7 +94,6 @@ module OpenHAB
|
|
97
94
|
#
|
98
95
|
def updated(*items, to: nil)
|
99
96
|
items.flatten.each do |item|
|
100
|
-
item = item.group if item.is_a? Group
|
101
97
|
logger.trace("Creating updated trigger for item(#{item}) to(#{to})")
|
102
98
|
[to].flatten.each do |to_state|
|
103
99
|
case item
|
@@ -129,7 +125,6 @@ module OpenHAB
|
|
129
125
|
#
|
130
126
|
def changed(*items, to: nil, from: nil, for: nil)
|
131
127
|
items.flatten.each do |item|
|
132
|
-
item = item.group if item.is_a? Group
|
133
128
|
logger.trace("Creating changed trigger for entity(#{item}), to(#{to}), from(#{from})")
|
134
129
|
# for is a reserved word in ruby, so use local_variable_get :for
|
135
130
|
if (wait_duration = binding.local_variable_get(:for))
|
@@ -113,6 +113,19 @@ module OpenHAB
|
|
113
113
|
def my(&block)
|
114
114
|
@caller.instance_eval(&block)
|
115
115
|
end
|
116
|
+
|
117
|
+
#
|
118
|
+
# Create a logger where name includes rule name if name is set
|
119
|
+
#
|
120
|
+
# @return [Logging::Logger] Logger with name that appended with rule name if rule name is set
|
121
|
+
#
|
122
|
+
def logger
|
123
|
+
if name
|
124
|
+
Logging.logger(name.chomp.gsub(/\s+/, '_'))
|
125
|
+
else
|
126
|
+
super
|
127
|
+
end
|
128
|
+
end
|
116
129
|
end
|
117
130
|
|
118
131
|
#
|
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: 2.
|
4
|
+
version: 2.14.0
|
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-02-
|
11
|
+
date: 2021-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|