openhab-scripting 4.42.2 → 4.43.0

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: '08c9201c21983751d80e9c2e4df683c39cef20763a5321fd2f8fdcd355cdb6c5'
4
- data.tar.gz: f0b2c25837d2396e70d11ba503920ff443992bd9cf007b18a2003f6857a17929
3
+ metadata.gz: 3ced4a751b4de9b352e205574f4351ed291efe23b2b096b5be7f40e12cc20777
4
+ data.tar.gz: 914351269a8c397536cb1df56907891565d9214b1d11f6124543dbf91b6aa0f2
5
5
  SHA512:
6
- metadata.gz: bff012a5dc7caf0e06fb9d0f3aede99afc9ad067004390ae606d392c34fe3662b017395fa3c200e759c2023e4801fb775ee097a29f0b90554f721d8fbbf9cf47
7
- data.tar.gz: b862f6f69383d86e1a230d2c702c440c0b6dd465ed22ec16ad03a47166bd319004a8f82147eed2da514b301523f99c917c9d93de56f6ea7b9907ab5713f9d61d
6
+ metadata.gz: e6f5fd13e613a4b4b018f73236bb050b5b80f1087ac24e6747d5b5aa710920ad9b9bc6bbc56d437b4b8c8ba39f9db516995b15d64592ad813e4bee276ba79b67
7
+ data.tar.gz: fbee80a3b22ad7c2ee83c42e6294602a88b522926340fe0d5f089a76284b7742bc1d50352de8d2c087fd1a399b810f0182ea8c15f4d2e666eb86465ce6b907d1
@@ -33,7 +33,7 @@ module OpenHAB
33
33
  # @param [Hash] values Keys and values to set for running thread, if hash is nil no values are set
34
34
  #
35
35
  def thread_local(**values, &block)
36
- ThreadLocal.thread_local(values, &block)
36
+ ThreadLocal.thread_local(**values, &block)
37
37
  end
38
38
  end
39
39
  end
@@ -101,6 +101,18 @@ module OpenHAB
101
101
  volume = Types::PercentType.new(volume) unless volume.is_a?(Types::PercentType) || volume.nil?
102
102
  Audio.playSound sink&.to_s, filename.to_s, volume
103
103
  end
104
+
105
+ #
106
+ # Play an audio stream from an URL to the given sink(s). Set url to nil if streaming should be stopped
107
+ #
108
+ # @param [String] url The URL of the audio stream
109
+ # @param [String] sink The audio sink, or nil to use the default audio sink
110
+ #
111
+ # @return [void]
112
+ #
113
+ def play_stream(url, sink: nil)
114
+ Audio.playStream sink&.to_s, url
115
+ end
104
116
  end
105
117
  end
106
118
  end
@@ -88,6 +88,7 @@ module OpenHAB
88
88
  @item.__send__(method, *args, &block)
89
89
  end
90
90
  end
91
+ ruby2_keywords :method_missing if respond_to? :ruby2_keywords
91
92
 
92
93
  # .
93
94
  def respond_to_missing?(method, include_private = false)
@@ -173,7 +173,7 @@ module OpenHAB
173
173
  def execute(_mod = nil, inputs = nil)
174
174
  OpenHAB::DSL.import_presets
175
175
  @semaphore.synchronize do
176
- thread_local(@thread_locals) do
176
+ thread_local(**@thread_locals) do
177
177
  logger.trace "Canceling implicit timer #{@timed_command_details.timer} for "\
178
178
  "#{@timed_command_details.item.id} because received event #{inputs}"
179
179
  @timed_command_details.timer.cancel
@@ -35,6 +35,7 @@ module OpenHAB
35
35
  from = Conditions::Proc.from_value(from)
36
36
  @conditions = Conditions::Proc.new(to: to, from: from)
37
37
  @duration = duration
38
+ @timer = nil
38
39
  logger.trace "Created Duration Condition To(#{to}) From(#{from}) "\
39
40
  "Conditions(#{@conditions}) Duration(#{@duration})"
40
41
  end
@@ -82,7 +82,7 @@ module OpenHAB
82
82
  OpenHAB::DSL.import_presets
83
83
  semaphore.synchronize do
84
84
  Timers.timer_manager.delete(self)
85
- thread_local(@thread_locals) do
85
+ thread_local(**@thread_locals) do
86
86
  yield(self)
87
87
  end
88
88
  end
@@ -212,7 +212,7 @@ module OpenHAB
212
212
  .then { |klass| java_klass(klass) }
213
213
  .then(&:name)
214
214
  .then { |name| filter_base_classes(name) }
215
- .then { |name| name&.prepend('.') }
215
+ .then { |name| ".#{name}" unless name.nil? } # name is frozen in jruby 9.4
216
216
  end
217
217
 
218
218
  # Get the appropriate java class for the supplied klass if the supplied
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '4.42.2'
8
+ VERSION = '4.43.0'
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: 4.42.2
4
+ version: 4.43.0
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: 2022-06-29 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler