openhab-scripting 5.23.0 → 5.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openhab/core/profile_factory.rb +7 -0
- data/lib/openhab/dsl/version.rb +1 -1
- data/lib/openhab/dsl.rb +5 -2
- 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: 877111a63ad97dc96a55cc8507e90c2d3e47f38b9f9614f7e37fb7e96ad6a063
|
4
|
+
data.tar.gz: 14d3eafc13ba69c845382313bbddd9126feda2a954259964e38f3a3cad096af8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b1d9b3d51144dbdd8f5666426f67c467bca0ef9dd183c378f124618a4ebfe4d32a235311f2b1c3639a47625469d9154354208286f76af63edc5cd2f4c566c19
|
7
|
+
data.tar.gz: 234a45207ded57376397ea92cd9c9b1dc8384c30851ec19aa909a69d02ee5230fcc64b7b10c1194d39f4ab70f24ea5a5660def33c4f874b7f7628d1afa6e075b
|
@@ -21,6 +21,7 @@ module OpenHAB
|
|
21
21
|
else
|
22
22
|
include org.openhab.core.thing.profiles.StateProfile
|
23
23
|
end
|
24
|
+
include org.openhab.core.thing.profiles.TriggerProfile
|
24
25
|
|
25
26
|
def initialize(callback, context, uid, thread_locals, block)
|
26
27
|
unless callback.class.ancestors.include?(Things::ProfileCallback)
|
@@ -69,6 +70,11 @@ module OpenHAB
|
|
69
70
|
process_event(:state_from_item, state: state)
|
70
71
|
end
|
71
72
|
|
73
|
+
# @!visibility private
|
74
|
+
def onTriggerFromHandler(event)
|
75
|
+
process_event(:trigger_from_handler, trigger: event)
|
76
|
+
end
|
77
|
+
|
72
78
|
# @deprecated OH 4.0 guard is only needed for < OH 4.1
|
73
79
|
if OpenHAB::Core.version >= OpenHAB::Core::V4_1
|
74
80
|
# @!visibility private
|
@@ -90,6 +96,7 @@ module OpenHAB
|
|
90
96
|
params[:channel_uid] = @callback.link.linked_uid
|
91
97
|
params[:state] ||= nil
|
92
98
|
params[:command] ||= nil
|
99
|
+
params[:trigger] ||= nil
|
93
100
|
# @deprecated OH 4.0 guard is only needed for < OH 4.1
|
94
101
|
params[:time_series] ||= nil if OpenHAB::Core.version >= OpenHAB::Core::V4_1
|
95
102
|
|
data/lib/openhab/dsl/version.rb
CHANGED
data/lib/openhab/dsl.rb
CHANGED
@@ -106,14 +106,16 @@ module OpenHAB
|
|
106
106
|
# @param [String, nil] label The label for the profile. When nil, the profile will not be visible in the UI.
|
107
107
|
# @param [org.openhab.core.config.core.ConfigDescription, nil] config_description
|
108
108
|
# The configuration description for the profile so that it can be configured in the UI.
|
109
|
-
# @yield [event, command: nil, state: nil, time_series: nil, callback:, link:, item:, channel_uid:, configuration:, context:]
|
109
|
+
# @yield [event, command: nil, state: nil, trigger: nil, time_series: nil, callback:, link:, item:, channel_uid:, configuration:, context:]
|
110
110
|
# All keyword params are optional. Any that aren't defined won't be passed.
|
111
|
-
# @yieldparam [:command_from_item, :state_from_item, :command_from_handler, :state_from_handler, :time_series_from_handler] event
|
111
|
+
# @yieldparam [:command_from_item, :state_from_item, :command_from_handler, :state_from_handler, :time_series_from_handler, :trigger_from_handler] event
|
112
112
|
# The event that needs to be processed.
|
113
113
|
# @yieldparam [Command, nil] command
|
114
114
|
# The command being sent for `:command_from_item` and `:command_from_handler` events.
|
115
115
|
# @yieldparam [State, nil] state
|
116
116
|
# The state being sent for `:state_from_item` and `:state_from_handler` events.
|
117
|
+
# @yieldparam [String] trigger
|
118
|
+
# The event being sent for `:trigger_from_handler` events.
|
117
119
|
# @yieldparam [TimeSeries] time_series
|
118
120
|
# The time series for `:time_series_from_handler` events.
|
119
121
|
# Only available since openHAB 4.1.
|
@@ -131,6 +133,7 @@ module OpenHAB
|
|
131
133
|
# @see org.openhab.core.thing.profiles.Profile
|
132
134
|
# @see org.openhab.core.thing.profiles.StateProfile
|
133
135
|
# @see org.openhab.core.thing.profiles.TimeSeriesProfile
|
136
|
+
# @see org.openhab.core.thing.profiles.TriggerProfile
|
134
137
|
#
|
135
138
|
# @example Vetoing a command
|
136
139
|
# profile(:veto_closing_shades) do |event, item:, command:|
|
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.
|
4
|
+
version: 5.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian O'Connell
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-07-
|
13
|
+
date: 2024-07-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|