openhab-scripting 5.32.0 → 5.33.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: c429ef46e5d646b8f63faf413faba1e687c3b02eac385044c85c863e70c9fda1
4
- data.tar.gz: 4b8f584ce037d55980f4277e35d9ebcf3a7b2a5b1ad14dce3b2c721d453c2af6
3
+ metadata.gz: 96a5a45996611268693311513fde61baca47e46134e1184ac6556b29a567689f
4
+ data.tar.gz: 8a70e85d3d9b892cca7b3ee9b912751a9c702ff784dc4827ecc16ef816d58c5c
5
5
  SHA512:
6
- metadata.gz: d2d281ff53a48073de43d5c9e60c77a3a8b3f5abdb09ece70efdd9f55fa72e3f70a30a27474e01ec671a0c2328261d36d15ad7726a0327daa071bb8f819362f3
7
- data.tar.gz: 5f897a7f16b1d20f9acc401af93b8b15b3cc8ffe7d02e67255db53ea0d5466300689f98344c11f42d362cb09f11880b85ce41f171b9921de67abee840a6e7d12
6
+ metadata.gz: 04b505a18d90437f38ed06005efa1815601a67b471da37814f8284e62aa6f92e6ac7955c726f4c1455f210c5fe0afcb350ae0ddc23722adec2906be307741ec7
7
+ data.tar.gz: dd080606344af5b3e9eea7310a7dad12b38fa18dbd2d028e04c46275d316c60ee0e5a44a23b474120fced82eeee655b0e429e336027a3d49a115e779e94e0c0e
@@ -12,7 +12,7 @@ module OpenHAB
12
12
  # "User-Agent": "JRuby/1.2.3", # enclose in quotes if the key contains dashes
13
13
  # Accept: "application/json",
14
14
  # }
15
- # response = HTTP.send_http_get_request("http://example.com/list", headers: headers)
15
+ # response = HTTP.get("http://example.com/list", headers: headers)
16
16
  #
17
17
  # @see https://www.openhab.org/docs/configuration/actions.html#http-actions HTTP Actions
18
18
  class HTTP
@@ -33,6 +33,7 @@ module OpenHAB
33
33
 
34
34
  sendHttpGetRequest(url, headers.transform_keys(&:to_s), timeout)
35
35
  end
36
+ alias_method :get, :send_http_get_request
36
37
 
37
38
  #
38
39
  # Sends an HTTP PUT request and returns the result as a String.
@@ -52,6 +53,7 @@ module OpenHAB
52
53
 
53
54
  sendHttpPutRequest(url, content_type, content, headers.transform_keys(&:to_s), timeout)
54
55
  end
56
+ alias_method :put, :send_http_put_request
55
57
 
56
58
  #
57
59
  # Sends an HTTP POST request and returns the result as a String.
@@ -71,6 +73,7 @@ module OpenHAB
71
73
 
72
74
  sendHttpPostRequest(url, content_type, content, headers.transform_keys(&:to_s), timeout)
73
75
  end
76
+ alias_method :post, :send_http_post_request
74
77
 
75
78
  #
76
79
  # Sends an HTTP DELETE request and returns the result as a String.
@@ -89,6 +92,7 @@ module OpenHAB
89
92
 
90
93
  sendHttpDeleteRequest(url, headers.transform_keys(&:to_s), timeout)
91
94
  end
95
+ alias_method :delete, :send_http_delete_request
92
96
  end
93
97
  end
94
98
  end
@@ -88,10 +88,14 @@ module OpenHAB
88
88
  # @!attribute [r] timestamp
89
89
  # @return [ZonedDateTime]
90
90
 
91
+ # @!attribute [r] instant
92
+ # @return [Instant] The timestamp as an Instant
93
+ # @since openHAB 4.3
94
+
91
95
  # @!attribute [r] name
92
96
  # @return [String] Item name
93
97
 
94
- delegate %i[timestamp name] => :@historic_item
98
+ delegate %i[timestamp instant name] => :@historic_item
95
99
 
96
100
  def initialize(historic_item, state = nil)
97
101
  @historic_item = historic_item
@@ -230,7 +230,9 @@ module OpenHAB
230
230
 
231
231
  # @deprecated OH3.4 missing registry
232
232
  if Provider.registry
233
- tag_class = service.get_by_label_or_synonym(id, locale).first ||
233
+ tag = service.get_by_label_or_synonym(id, locale)
234
+ tag = nil if tag&.empty?
235
+ tag_class = tag&.first ||
234
236
  Provider.registry.get_tag_class_by_id(id)
235
237
  return unless tag_class
236
238
 
@@ -193,6 +193,7 @@ module OpenHAB
193
193
  #
194
194
  # @return [String] The timezone in `[+-]hh:mm(:ss)` format (`Z` for UTC)
195
195
  #
196
+ # @deprecated This method has been deprecated in openHAB 4.3.
196
197
  def zone
197
198
  zoned_date_time.zone.id
198
199
  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.32.0"
7
+ VERSION = "5.33.1"
8
8
  end
9
9
  end
@@ -19,12 +19,13 @@ module OpenHAB
19
19
  class HistoricItem
20
20
  include org.openhab.core.persistence.HistoricItem
21
21
 
22
- attr_reader :timestamp, :state, :name
22
+ attr_reader :timestamp, :instant, :state, :name
23
23
 
24
24
  def initialize(timestamp, state, name)
25
25
  @timestamp = timestamp
26
26
  @state = state
27
27
  @name = name
28
+ @instant = @timestamp.to_instant
28
29
  end
29
30
  end
30
31
 
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openhab-scripting
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.32.0
4
+ version: 5.33.1
5
5
  platform: ruby
6
+ original_platform: ''
6
7
  authors:
7
8
  - Brian O'Connell
8
9
  - Cody Cutrer
9
10
  - Jimmy Tanagra
10
- autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-11-25 00:00:00.000000000 Z
13
+ date: 2024-12-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -222,7 +222,6 @@ dependencies:
222
222
  - - "~>"
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0.0'
225
- description:
226
225
  email:
227
226
  - broconne+github@gmail.com
228
227
  - cody@cutrer.us
@@ -475,7 +474,6 @@ metadata:
475
474
  documentation_uri: https://openhab.github.io/openhab-jruby/
476
475
  changelog_uri: https://openhab.github.io/openhab-jruby/file.CHANGELOG.html
477
476
  rubygems_mfa_required: 'true'
478
- post_install_message:
479
477
  rdoc_options: []
480
478
  require_paths:
481
479
  - lib
@@ -490,8 +488,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
490
488
  - !ruby/object:Gem::Version
491
489
  version: '0'
492
490
  requirements: []
493
- rubygems_version: 3.5.20
494
- signing_key:
491
+ rubygems_version: 3.6.0
495
492
  specification_version: 4
496
493
  summary: JRuby Helper Libraries for openHAB Scripting
497
494
  test_files: []