Skip to content

Commit

Permalink
Added volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Apr 14, 2016
1 parent c05f51c commit b586fce
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions lib/lita/handlers/onewheel_automatic_pancake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion lita-onewheel-automatic-pancake.gemspec
Original file line number Diff line number Diff line change
@@ -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.}
Expand Down

0 comments on commit b586fce

Please sign in to comment.