diff --git a/lib/lita/handlers/onewheel_automatic_pancake.rb b/lib/lita/handlers/onewheel_automatic_pancake.rb index c008f6c..387b3f8 100644 --- a/lib/lita/handlers/onewheel_automatic_pancake.rb +++ b/lib/lita/handlers/onewheel_automatic_pancake.rb @@ -15,6 +15,16 @@ class OnewheelAutomaticPancake < Handler command: true, help: {'kill' => 'MAKE IT STOP'} + route /^vol up/i, + :vol_up, + command: true, + help: {'vol up' => 'Turn it up!'} + + route /^vol down/i, + :vol_down, + command: true, + help: {'vol down' => 'Turn it down!'} + def play(response) search_term = response.matches[0][0] Lita.logger.debug "Search term found #{search_term}" @@ -30,6 +40,14 @@ def kill(response) kill_sound end + def vol_up(response) + RestClient.post "#{config.pancake_server}/vol/up", {} + end + + def vol_down(response) + RestClient.post "#{config.pancake_server}/vol/down", {} + end + def kill_sound uri = "#{config.pancake_server}/kill" Lita.logger.debug "Killing! #{uri}" diff --git a/lita-onewheel-automatic-pancake.gemspec b/lita-onewheel-automatic-pancake.gemspec index eab5421..99befab 100644 --- a/lita-onewheel-automatic-pancake.gemspec +++ b/lita-onewheel-automatic-pancake.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = 'lita-onewheel-automatic-pancake' - spec.version = '0.1.0' + spec.version = '0.2.0' spec.authors = ['Andrew Kreps'] spec.email = ['andrew.kreps@gmail.com'] spec.description = %q{Lita interface to Automatic Pancake.}