openhab-scripting 4.42.2 → 4.43.0
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 +4 -4
- data/lib/openhab/core/thread_local.rb +1 -1
- data/lib/openhab/dsl/actions.rb +12 -0
- data/lib/openhab/dsl/items/ensure.rb +1 -0
- data/lib/openhab/dsl/items/timed_command.rb +1 -1
- data/lib/openhab/dsl/rules/triggers/conditions/duration.rb +1 -0
- data/lib/openhab/dsl/timers/timer.rb +1 -1
- data/lib/openhab/log/logger.rb +1 -1
- data/lib/openhab/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ced4a751b4de9b352e205574f4351ed291efe23b2b096b5be7f40e12cc20777
|
4
|
+
data.tar.gz: 914351269a8c397536cb1df56907891565d9214b1d11f6124543dbf91b6aa0f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/openhab/dsl/actions.rb
CHANGED
@@ -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
|
@@ -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(
|
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
|
data/lib/openhab/log/logger.rb
CHANGED
@@ -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
|
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
|
data/lib/openhab/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|