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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '089e0d97f175f04c563675de122c80d0f5988be5ea38be8833736e4e73341a75'
4
- data.tar.gz: 4b98810dd2e4f01772272fc10e457b57e81ade54c19b1dc59a72afd85c368b5a
3
+ metadata.gz: 376e7ceca67ad5ca1dfedcacee9096e97819f3a382404ddde4f7beb579416e7d
4
+ data.tar.gz: bdffa11dab63e1910d38a1232c38e2b9d64deaac1d8ea3610de464792d75173e
5
5
  SHA512:
6
- metadata.gz: 67abc23128c151fdeb509f7a6c770696e0221b6a41a6e8af36628c891aa959c72e7ed7123d1e6d9711da3fe862eba2adaac9e3692e1026193cc7638e11de926a
7
- data.tar.gz: 4348d10e590f9e8179c3559c05ae2417cd9a75150d069e98f1566316e60a5d5ed12b4057b0d67272e97d92c813cbf337c97dac8d69b1cc5538b06576aa3084f7
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
  #
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '2.13.1'
8
+ VERSION = '2.14.0'
9
9
  end
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.13.1
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-02 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler