Module: Ketra::Commands
- Defined in:
- lib/ketra/commands.rb
Overview
This module is used to execute specific Ketra API commands
Class Method Summary collapse
-
.activate_button(keypad, button, level = 65535) ⇒ Hash
Activates a keypad button at a specific brightness level.
-
.deactivate_button(keypad, button) ⇒ Hash
Deactivates a keypad button.
-
.groups ⇒ Hash
Queries for the available Ketra Groups.
-
.keypads ⇒ Hash
Queries for the available Ketra Keypads.
-
.push_button(keypad, button) ⇒ Hash
Pushes a keypad button which will either activate or deactivate based on its current state and the configuration of the keypad settings.
Class Method Details
.activate_button(keypad, button, level = 65535) ⇒ Hash
Activates a keypad button at a specific brightness level
13 14 15 16 |
# File 'lib/ketra/commands.rb', line 13 def self.(keypad, , level=65535) Ketra.client.post("Keypads/#{keypad}/Buttons/#{}/Activate", :Level => level) end |
.deactivate_button(keypad, button) ⇒ Hash
Deactivates a keypad button
23 24 25 26 |
# File 'lib/ketra/commands.rb', line 23 def self.(keypad, ) Ketra.client.post("Keypads/#{keypad}/Buttons/#{}/Deactivate", :Level => 0) end |
.groups ⇒ Hash
Queries for the available Ketra Groups
49 50 51 |
# File 'lib/ketra/commands.rb', line 49 def self.groups Ketra.client.get("Groups") end |
.keypads ⇒ Hash
Queries for the available Ketra Keypads
42 43 44 |
# File 'lib/ketra/commands.rb', line 42 def self.keypads Ketra.client.get("Keypads") end |
.push_button(keypad, button) ⇒ Hash
Pushes a keypad button which will either activate or deactivate based on its current state and the configuration of the keypad settings
34 35 36 37 |
# File 'lib/ketra/commands.rb', line 34 def self.(keypad, ) Ketra.client.post("Keypads/#{keypad}/Buttons/#{}/PushButton", :query_params => { :idempotency_key => SecureRandom.hex }) end |