openhab-scripting 3.6.4 → 3.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openhab/dsl/rules/automation_rule.rb +3 -3
- data/lib/openhab/dsl/rules/rule_config.rb +5 -5
- data/lib/openhab/dsl/time_of_day.rb +3 -3
- data/lib/openhab/dsl/types/datetime.rb +1 -1
- data/lib/openhab/dsl/types/quantity.rb +4 -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: e6257fbf175a31d70a87ef41e0e6d53002c1dec31bb12ee0dd63687d656258ad
|
4
|
+
data.tar.gz: f4974c81d0035cc36b92e2b113ba1864eace902324ef6f4b5e7d4ecb4c02b1d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c2e373ed6446e2964767b478653e314bd97b8f75621ba2a9716f0d6dedb5c1fb65505e016b764c84ee2d092530f9510e9d8ba94e6770bfc46198ef1c9b5ee3c
|
7
|
+
data.tar.gz: 9c42e05c31c48ea52b996780a7e90b971848b0a6e81c51c8c477121addec8e45d9a275489e5e66aa6de7eca3533e8a7f35ce2bd5705bac17b341b49cfe8d1610
|
@@ -106,10 +106,10 @@ module OpenHAB
|
|
106
106
|
return true if check_to(trigger_delay, new_state)
|
107
107
|
|
108
108
|
logger.trace("Skipped execution of rule '#{name}' because to state #{new_state}"\
|
109
|
-
|
109
|
+
" does not equal specified state(#{trigger_delay.to})")
|
110
110
|
else
|
111
111
|
logger.trace("Skipped execution of rule '#{name}' because old state #{old_state}"\
|
112
|
-
|
112
|
+
" does not equal specified state(#{trigger_delay.from})")
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
@@ -237,7 +237,7 @@ module OpenHAB
|
|
237
237
|
return true if @between.cover? now
|
238
238
|
|
239
239
|
logger.trace("Skipped execution of rule '#{name}' because the current time #{now} "\
|
240
|
-
|
240
|
+
"is not between #{@between.begin} and #{@between.end}")
|
241
241
|
else
|
242
242
|
logger.trace("Skipped execution of rule '#{name}' because of guard #{@guard}")
|
243
243
|
end
|
@@ -140,11 +140,11 @@ module OpenHAB
|
|
140
140
|
#
|
141
141
|
def inspect
|
142
142
|
"Name: (#{name}) " \
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
143
|
+
"Triggers: (#{triggers}) " \
|
144
|
+
"Run blocks: (#{run}) " \
|
145
|
+
"on_start: (#{on_start?}) " \
|
146
|
+
"Trigger Waits: #{trigger_delays} " \
|
147
|
+
"Trigger UIDs: #{triggers.map(&:id).join(', ')}"
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -153,9 +153,9 @@ module OpenHAB
|
|
153
153
|
other_second_of_day = to_second_of_day(other)
|
154
154
|
logger.trace do
|
155
155
|
"SOD(#{sod}) "\
|
156
|
-
|
157
|
-
|
158
|
-
|
156
|
+
"other SOD(#{other_second_of_day}) "\
|
157
|
+
"Other Class (#{other.class}) "\
|
158
|
+
"Result (#{sod <=> other_second_of_day})"
|
159
159
|
end
|
160
160
|
sod <=> other_second_of_day
|
161
161
|
end
|
@@ -152,7 +152,7 @@ module OpenHAB
|
|
152
152
|
# @return [Float] Number of seconds since the Epoch, with nanosecond presicion
|
153
153
|
#
|
154
154
|
def to_f
|
155
|
-
zoned_date_time.to_epoch_second + zoned_date_time.nano / 1_000_000_000
|
155
|
+
zoned_date_time.to_epoch_second + (zoned_date_time.nano / 1_000_000_000)
|
156
156
|
end
|
157
157
|
|
158
158
|
#
|
@@ -20,6 +20,7 @@ module OpenHAB
|
|
20
20
|
include OpenHAB::Log
|
21
21
|
|
22
22
|
def_delegator :@quantity, :to_s
|
23
|
+
def_delegators '@quantity.double_value', :positive?, :negative?, :zero?
|
23
24
|
|
24
25
|
java_import org.openhab.core.library.types.QuantityType
|
25
26
|
java_import org.openhab.core.library.types.DecimalType
|
@@ -146,7 +147,7 @@ module OpenHAB
|
|
146
147
|
define_method(operation) do |other|
|
147
148
|
logger.trace do
|
148
149
|
"Executing math operation '#{operation}' on quantity #{inspect} "\
|
149
|
-
|
150
|
+
"with other type #{other.class} and value #{other.inspect}"
|
150
151
|
end
|
151
152
|
|
152
153
|
a, b = to_qt(coerce(other).reverse)
|
@@ -185,8 +186,8 @@ module OpenHAB
|
|
185
186
|
#
|
186
187
|
# @return [Array] Array of QuantityType objects
|
187
188
|
#
|
188
|
-
def to_qt(*
|
189
|
-
[
|
189
|
+
def to_qt(*quantities)
|
190
|
+
[quantities].flatten.compact.map { |item| item.is_a?(Quantity) ? item.quantity : item }
|
190
191
|
end
|
191
192
|
|
192
193
|
#
|
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.
|
4
|
+
version: 3.7.3
|
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-
|
11
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|