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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 781c6dc088d4de8ff0220c44e5f1985b6dce89d8579cbfc268dc6e2a750340b5
4
- data.tar.gz: 92474c9a60e792b1c271f2452276cbdf9a5c7279e8a2913e6f88ca80b6aa7a1f
3
+ metadata.gz: e6257fbf175a31d70a87ef41e0e6d53002c1dec31bb12ee0dd63687d656258ad
4
+ data.tar.gz: f4974c81d0035cc36b92e2b113ba1864eace902324ef6f4b5e7d4ecb4c02b1d8
5
5
  SHA512:
6
- metadata.gz: 9fc179dd14e9639c7734f7e91e44fdcb0a9fbbc7526f7a18897b9b7849624f55557369a7fd7f30b79c8581967dc76c3c0c7affde66ee1e702df4fabe0861a364
7
- data.tar.gz: cb8a8e31a9ef8ced5f0c1a0c2e51c0f5c308b6789137fd079951f7874829910c73e8ebe913179690a9c8e8fba28340921472f390abeea1eee4c9a6b42a4f8138
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
- " does not equal specified state(#{trigger_delay.to})")
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
- " does not equal specified state(#{trigger_delay.from})")
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
- "is not between #{@between.begin} and #{@between.end}")
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
- "Triggers: (#{triggers}) " \
144
- "Run blocks: (#{run}) " \
145
- "on_start: (#{on_start?}) " \
146
- "Trigger Waits: #{trigger_delays} " \
147
- "Trigger UIDs: #{triggers.map(&:id).join(', ')}"
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
- "other SOD(#{other_second_of_day}) "\
157
- "Other Class (#{other.class}) "\
158
- "Result (#{sod <=> other_second_of_day})"
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
- "with other type #{other.class} and value #{other.inspect}"
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(*quanities)
189
- [quanities].flatten.compact.map { |item| item.is_a?(Quantity) ? item.quantity : item }
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
  #
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '3.6.4'
8
+ VERSION = '3.7.3'
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: 3.6.4
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-06-04 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler