This module is used to execute specific Ketra API commands
Public Class Methods
activate_button(keypad, button, level=65535)click to toggle source
Activates a keypad button at a specific brightness level
@param [String] keypad the GUID or Name of the keypad containing the button you want to activate @param [String] button the GUID or Name of the keypad button you want to activate @param [Integer] level (65535) the brightness level from 0 to 65535 @return [Hash] deserialized response hash
# File lib/ketra/commands.rb, line 13defself.activate_button(keypad, button, level=65535)
Ketra.client.post("Keypads/#{keypad}/Buttons/#{button}/Activate",
:Level=>level)
end
deactivate_button(keypad, button)click to toggle source
Deactivates a keypad button
@param [String] keypad the GUID or Name of the keypad containing the button you want to deactivate @param [String] button the GUID or Name of the keypad button you want to deactivate @return [Hash] deserialized response hash
# File lib/ketra/commands.rb, line 23defself.deactivate_button(keypad, button)
Ketra.client.post("Keypads/#{keypad}/Buttons/#{button}/Deactivate",
:Level=>0)
end
@return [Hash] deserialized response hash containing the keypad info, see Ketra API documentation for details
# File lib/ketra/commands.rb, line 42defself.keypadsKetra.client.get("Keypads")
end
push_button(keypad, button)click to toggle source
Pushes a keypad button which will either activate or deactivate based on its current state and the configuration of the keypad settings
@param [String] keypad the GUID or Name of the keypad containing the button you want to deactivate @param [String] button the GUID or Name of the keypad button you want to deactivate @return [Hash] deserailized response hash
# File lib/ketra/commands.rb, line 34defself.push_button(keypad, button)
Ketra.client.post("Keypads/#{keypad}/Buttons/#{button}/PushButton",
:query_params=> { :idempotency_key=>SecureRandom.hex })
end