openhab-scripting 3.9.0 → 3.9.4
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/entity_lookup.rb +1 -1
- data/lib/openhab/dsl/timers.rb +2 -2
- data/lib/openhab/dsl/types/datetime.rb +3 -3
- 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: 356cf9cd952afd9acdbdb1ee202360b5403b45f252763a5bf9cdfbb3b48f80d6
|
4
|
+
data.tar.gz: 813a84b33014c8c6248b7084140c412582d3889226caf08de9e1160452cd50ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 739813b353f513abdb50afff61047f75a7ae96e26b42bf6381e039ef3c35ca7535f696475ccbd999bb79925bee83ecb412533306ce4f7af8566c2a22db4fab8f
|
7
|
+
data.tar.gz: 443ad43667b89e0231247879e5dc9eddcf479b9ef2f05f09c08a931e1b13e2a96b1075c2870c95cb608c021e84b17e72850d9b5fb6e7c174f5bfee0d82e86522
|
@@ -129,7 +129,7 @@ module OpenHAB
|
|
129
129
|
# Thing UIDs have at least 3 segements
|
130
130
|
return if name.count('_') < 3
|
131
131
|
|
132
|
-
name = name.
|
132
|
+
name = name.tr('_', ':')
|
133
133
|
# rubocop: disable Style/GlobalVars
|
134
134
|
$things.get(Java::OrgOpenhabCoreThing::ThingUID.new(name))
|
135
135
|
# rubocop: enable Style/GlobalVars
|
data/lib/openhab/dsl/timers.rb
CHANGED
@@ -31,14 +31,14 @@ module OpenHAB
|
|
31
31
|
# @param [Duration] duration Duration until timer should fire
|
32
32
|
# @param [Block] block Block to execute when timer fires
|
33
33
|
#
|
34
|
-
def initialize(duration
|
34
|
+
def initialize(duration:)
|
35
35
|
@duration = duration
|
36
36
|
|
37
37
|
# A semaphore is used to prevent a race condition in which calling the block from the timer thread
|
38
38
|
# occurs before the @timer variable can be set resulting in @timer being nil
|
39
39
|
semaphore = Mutex.new
|
40
40
|
|
41
|
-
timer_block = proc { semaphore.synchronize {
|
41
|
+
timer_block = proc { semaphore.synchronize { yield(self) } }
|
42
42
|
|
43
43
|
semaphore.synchronize do
|
44
44
|
@timer = ScriptExecution.createTimer(
|
@@ -81,7 +81,7 @@ module OpenHAB
|
|
81
81
|
|
82
82
|
case other
|
83
83
|
when TimeOfDay::TimeOfDay, TimeOfDay::TimeOfDayRangeElement then to_tod <=> other
|
84
|
-
when String then self <=> DateTime.parse(DATE_ONLY_REGEX
|
84
|
+
when String then self <=> DateTime.parse(DATE_ONLY_REGEX.match?(other) ? "#{other}'T'00:00:00#{zone}" : other)
|
85
85
|
else
|
86
86
|
self <=> DateTime.from(other)
|
87
87
|
end
|
@@ -120,7 +120,7 @@ module OpenHAB
|
|
120
120
|
when Numeric then DateTime.from(to_time - other)
|
121
121
|
when String
|
122
122
|
dt = DateTime.parse(other)
|
123
|
-
TIME_ONLY_REGEX
|
123
|
+
TIME_ONLY_REGEX.match?(other) ? self - dt.to_f : time_diff(dt)
|
124
124
|
when Duration then DateTime.new(zoned_date_time.minus(other))
|
125
125
|
when Time, DateTime, DateTimeType, DateTimeItem then time_diff(other)
|
126
126
|
end
|
@@ -298,7 +298,7 @@ module OpenHAB
|
|
298
298
|
# @return [Java::org::openhab::core::library::types::DateTimeType] Object representing the same time
|
299
299
|
#
|
300
300
|
def self.parse(time_string)
|
301
|
-
time_string += 'Z' if TIME_ONLY_REGEX
|
301
|
+
time_string += 'Z' if TIME_ONLY_REGEX.match?(time_string)
|
302
302
|
DateTime.new(DateTimeType.new(time_string))
|
303
303
|
rescue Java::JavaLang::StringIndexOutOfBoundsException, Java::JavaLang::IllegalArgumentException
|
304
304
|
# Try ruby's Time.parse if OpenHAB's DateTimeType parser fails
|
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.9.
|
4
|
+
version: 3.9.4
|
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-09-
|
11
|
+
date: 2021-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|