alexa_hue 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9899901a0800aaac312d75eba07974c4caf1777f
4
- data.tar.gz: 63a10072deb984d0c3a9f5908e82a2c61474fc24
3
+ metadata.gz: faac54187d611c92ba6acb601b8af09d05cb92cc
4
+ data.tar.gz: 43b12f115a8d702872f7805fa5739b7db1b46470
5
5
  SHA512:
6
- metadata.gz: 392e2fde49d7b0cfca31e316817fd674abe79663bb65c7596a9df49322b820a9fe6b9da9f4c6c83286516bf4316e94e18959023e6bd521c4d6fb6d8016c24f1a
7
- data.tar.gz: 6118cb8026c5b30b063e80582652013705cc03b7aa9523de7850bbf4e630d9c59861bf5db2f8f06dbe0cd7965be6834113181577c156247e4632cdc22c004fad
6
+ metadata.gz: 13b99fb1f4a80cc860fe96924e37fb01436104463d2bc800902ebf4c76f25da69bd55c749516b27af758b83b97583d1bb06427520f83cba39a377d3889459afa
7
+ data.tar.gz: 95b0ded44ded0b12901645833e4deed51a636eeee0a6fefbb8b6c9ec45935be1eaf33d4d4f8e5ec0f99428962381a14327dd4ff1d015f549d1e57b517907cf5d
@@ -1,4 +1,4 @@
1
1
  module Hue
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
4
4
 
data/lib/alexa_hue.rb CHANGED
@@ -20,6 +20,16 @@ module Hue
20
20
  extend Sinatra::Extension
21
21
 
22
22
  helpers do
23
+ def switch
24
+ begin
25
+ @switch = Hue::VoiceParser.new
26
+ rescue RuntimeError
27
+ halt AlexaObjects::Response.new(spoken_response: "Hello. Before using Hue lighting, you'll need to give me access to your Hue bridge. Please press the link button on your bridge and launch the skill again within ten seconds.").to_json
28
+ end
29
+
30
+ @switch
31
+ end
32
+
23
33
  def control_lights
24
34
  if @echo_request.slots.brightness
25
35
  LEVELS.keys.reverse_each { |level| @echo_request.slots.brightness.sub!(level, LEVELS[level]) } if @echo_request.slots.schedule.nil?
@@ -49,11 +59,7 @@ module Hue
49
59
  @string.sub!("color loop", "colorloop")
50
60
  @string.strip!
51
61
 
52
- begin
53
- switch = Hue::Switch.new
54
- rescue RuntimeError
55
- halt AlexaObjects::Response.new(spoken_response: "Hello. Before using Hue lighting, you'll need to give me access to your Hue bridge. Please press the link button on your bridge and launch the skill again within ten seconds.").to_json
56
- end
62
+
57
63
 
58
64
  if @echo_request.slots.lights.nil? && @echo_request.slots.scene.nil? && @echo_request.slots.savescene.nil?
59
65
  halt AlexaObjects::Response.new(end_session: false, spoken_response: "Please specify which light or lights you'd like to adjust. I'm ready to control the lights.").to_json
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alexa_hue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Lucas