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

Instance Method Details

#handle_command(command) ⇒ Object

Forward the given command to the respective thing handler.

Parameters:



26
27
28
29
# File 'lib/openhab/core/things/profile_callback.rb', line 26

def handle_command(command)
  command = ProfileCallback.dummy_channel_item(link.channel.accepted_item_type)&.format_command(command)
  super
end

#send_command(command) ⇒ Object

Send a command to the framework.

Parameters:



36
37
38
39
# File 'lib/openhab/core/things/profile_callback.rb', line 36

def send_command(command)
  command = link.item.format_command(command)
  super
end

#send_time_series(time_series) ⇒ Object

Send a time series to the framework.

Parameters:

Since:

  • openHAB 4.1



# File 'lib/openhab/core/things/profile_callback.rb', line 51

#send_update(state) ⇒ Object

Send a state update to the framework.

Parameters:



46
47
48
49
# File 'lib/openhab/core/things/profile_callback.rb', line 46

def send_update(state)
  state = link.item.format_update(state)
  super
end