openhab-scripting 5.34.0 → 5.34.2

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: 9300c92dc3d585e27528126b0a04b3b6f54a3af5e48ebbdd967b52b6b8d3efe8
4
- data.tar.gz: 4f0a4331c7cd29d49c3013cee2033536ec5095471a82bd3b6e4fe6acfbf4fa8d
3
+ metadata.gz: 60f2430df81cdc2c1455081302fe53ae038559a284713a130c1f8ed31dc18662
4
+ data.tar.gz: 1303d6cf57456fc36a09b2c097278afff9ebad5c01cf021117bee12a326364f6
5
5
  SHA512:
6
- metadata.gz: bbd50fbc7ae916736accef799f512a2213995ed839c28117ad96eb3be9ac79344df192ad7d5e131deb58b2a49fdc1124f146f711aa1c784099b5947e62465e6d
7
- data.tar.gz: 9610a22c54a861856349bbaf77c7a450f7905e3be390aa9a12389d30f17e07ba708fd8516079c89dfd13e79a76e2d99630e3da43bc9bc1dcbf98b7de942d0103
6
+ metadata.gz: afe16ead5472cbd62cc0d270c62f155816ed4f5d6ac280ae48afb1ab4d8153d62457761dbbb680fba9f05275a2be213619dc5055dbb8d9f6db5431f5407c2366
7
+ data.tar.gz: ee914d04941db213144cfa8a34a2e903807cb304154de5ee8668f431c91a5c892de248c4f9b43ea92a5c6201c605a2663c123059ef0ca4d07f184162fd39732b
@@ -5,7 +5,15 @@ module OpenHAB
5
5
  module Java
6
6
  Duration = java.time.Duration
7
7
 
8
+ #
8
9
  # Extensions to {java.time.Duration Java Duration}
10
+ #
11
+ # Ruby's {Integer} and {Float} classes are extended to allow convenient creation of {Duration} instances.
12
+ #
13
+ # @example
14
+ # 5.seconds # => #<Duration PT5S>
15
+ # 2.5.hours # => #<Duration PT2H30M>
16
+ #
9
17
  class Duration
10
18
  include Between
11
19
  # @!parse include TemporalAmount
@@ -102,8 +102,7 @@ module OpenHAB
102
102
  # during conversion. {ZonedDateTime.now} is assumed if not given.
103
103
  # @return [Instant]
104
104
  def to_instant(context = nil)
105
- zone = context&.zone || java.time.ZoneOffset::UTC
106
- at_start_of_day(zone).to_instant
105
+ to_zoned_date_time(context).to_instant
107
106
  end
108
107
  end
109
108
  end
@@ -112,12 +112,15 @@ module OpenHAB
112
112
  context.with(self)
113
113
  end
114
114
 
115
+ #
116
+ # Converts the LocalTime (in the system timezone) to an Instant (in Zulu time).
117
+ #
115
118
  # @param [ZonedDateTime, nil] context
116
119
  # A {ZonedDateTime} used to fill in missing fields
117
120
  # during conversion. {ZonedDateTime.now} is assumed if not given.
118
121
  # @return [Instant]
122
+ #
119
123
  def to_instant(context = nil)
120
- context ||= Instant.now.to_zoned_date_time
121
124
  to_zoned_date_time(context).to_instant
122
125
  end
123
126
  end
@@ -2162,6 +2162,7 @@ module OpenHAB
2162
2162
  added_rule.actions.first.configuration.put("script", script) if script
2163
2163
 
2164
2164
  if enabled
2165
+ added_rule.enable unless added_rule.enabled?
2165
2166
  process_on_load { |module_id| rule.execute(nil, { "module" => module_id }) }
2166
2167
  else
2167
2168
  added_rule.disable
@@ -4,6 +4,6 @@ module OpenHAB
4
4
  module DSL
5
5
  # Version of openHAB helper libraries
6
6
  # @return [String]
7
- VERSION = "5.34.0"
7
+ VERSION = "5.34.2"
8
8
  end
9
9
  end
data/lib/openhab/dsl.rb CHANGED
@@ -157,7 +157,7 @@ module OpenHAB
157
157
  # profile(:set_uom) do |event, callback:, configuration:, state:, command:|
158
158
  # unless configuration["unit"]
159
159
  # logger.warn("Unit configuration not provided for set_uom profile")
160
- # next true
160
+ # next true
161
161
  # end
162
162
  #
163
163
  # case event
@@ -187,7 +187,7 @@ module OpenHAB
187
187
  # end
188
188
  #
189
189
  # profile(:range_filter, label: "Range Filter", config_description: config_description) do |event, state:, configuration:|
190
- # return true unless event == :state_from_handler
190
+ # next true unless event == :state_from_handler
191
191
  #
192
192
  # (configuration["min"]..configuration["max"]).cover?(state)
193
193
  # end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openhab-scripting
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.34.0
4
+ version: 5.34.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian O'Connell
@@ -9,7 +9,7 @@ authors:
9
9
  - Jimmy Tanagra
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-01-03 00:00:00.000000000 Z
12
+ date: 2025-02-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -487,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
487
487
  - !ruby/object:Gem::Version
488
488
  version: '0'
489
489
  requirements: []
490
- rubygems_version: 3.6.2
490
+ rubygems_version: 3.6.3
491
491
  specification_version: 4
492
492
  summary: JRuby Helper Libraries for openHAB Scripting
493
493
  test_files: []