openhab-scripting 5.34.0 → 5.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9300c92dc3d585e27528126b0a04b3b6f54a3af5e48ebbdd967b52b6b8d3efe8
4
- data.tar.gz: 4f0a4331c7cd29d49c3013cee2033536ec5095471a82bd3b6e4fe6acfbf4fa8d
3
+ metadata.gz: fce096267797942787402ee95f2c757c3629772b64d061bda1aa3b3c7046fca6
4
+ data.tar.gz: 9fcaf3ee9bba2e9c18a696de78fbe644cf8e30ca9edc629549d2a74bcadbacac
5
5
  SHA512:
6
- metadata.gz: bbd50fbc7ae916736accef799f512a2213995ed839c28117ad96eb3be9ac79344df192ad7d5e131deb58b2a49fdc1124f146f711aa1c784099b5947e62465e6d
7
- data.tar.gz: 9610a22c54a861856349bbaf77c7a450f7905e3be390aa9a12389d30f17e07ba708fd8516079c89dfd13e79a76e2d99630e3da43bc9bc1dcbf98b7de942d0103
6
+ metadata.gz: 66a8b0bda211a633650d76306c3fbcd1a78a2a29eda5520f05952387eceb514470ab161f6115c2bfa6a75632a649f7ccfb11c756e44984b524c71d3d4946ab7b
7
+ data.tar.gz: 9dc227346259c8a2f593972e79bc25d60757ef96b832de2f832a6a8d2c81f35e787c308bce8c12a6f38c9d42124a7372dd1057aecd3a3a8eef42989f6e655db5
@@ -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
@@ -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.1"
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.1
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-04 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: []