openhab-scripting 5.23.0 → 5.24.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55ff8734004f7befde1f1d3bb27560cfc8c5dbb7287f8dbb5e19a50fadec0d23
4
- data.tar.gz: dba9276e8b4845e1b265973440aa0e036da3137176ba44c5c256ddfcd5dad227
3
+ metadata.gz: 877111a63ad97dc96a55cc8507e90c2d3e47f38b9f9614f7e37fb7e96ad6a063
4
+ data.tar.gz: 14d3eafc13ba69c845382313bbddd9126feda2a954259964e38f3a3cad096af8
5
5
  SHA512:
6
- metadata.gz: 6c4692d9a8ce6104b511e1475e01fcae49f0fda6bdf04f498c26b023237f8332e87166cbdc5e2754f1375b4e2cbf31f70c706e68beda3657d6f09b28d37b59bf
7
- data.tar.gz: 133e78f26b440c5ffbb628ee323d56d2e4b4e74c1a65762cec75818f7ebfe5eeda4275e7cd6157fb68d90d551c5e2b4c984016c149abf222dc1917428f4c7e49
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
 
@@ -4,6 +4,6 @@ module OpenHAB
4
4
  module DSL
5
5
  # Version of openHAB helper libraries
6
6
  # @return [String]
7
- VERSION = "5.23.0"
7
+ VERSION = "5.24.0"
8
8
  end
9
9
  end
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.23.0
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-22 00:00:00.000000000 Z
13
+ date: 2024-07-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler