Module: OpenHAB::Core::Things::ProfileCallback
- Defined in:
- lib/openhab/core/things/profile_callback.rb
Overview
Contains methods for profile's callback to forward commands between items and channels.
Instance Method Summary collapse
-
#handle_command(command) ⇒ Object
Forward the given command to the respective thing handler.
-
#send_command(command) ⇒ Object
Send a command to the framework.
-
#send_time_series(time_series) ⇒ Object
Send a time series to the framework.
-
#send_update(state) ⇒ Object
Send a state update to the framework.
Instance Method Details
#handle_command(command) ⇒ Object
Forward the given command to the respective thing handler.
16 17 18 19 20 21 22 |
# File 'lib/openhab/core/things/profile_callback.rb', line 16 def handle_command(command) unless instance_variable_defined?(:@dummy_channel_item) @dummy_channel_item = DSL::Items::ItemBuilder.item_factory.create_item(link.channel.accepted_item_type, "") end command = @dummy_channel_item.format_command(command) if @dummy_channel_item super(command) end |
#send_command(command) ⇒ Object
Send a command to the framework.
29 30 31 32 |
# File 'lib/openhab/core/things/profile_callback.rb', line 29 def send_command(command) command = link.item.format_command(command) super(command) end |
#send_time_series(time_series) ⇒ Object
Send a time series to the framework.
|
# File 'lib/openhab/core/things/profile_callback.rb', line 44
|
#send_update(state) ⇒ Object
Send a state update to the framework.
39 40 41 42 |
# File 'lib/openhab/core/things/profile_callback.rb', line 39 def send_update(state) state = link.item.format_update(state) super(state) end |