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 +4 -4
- data/lib/alexa_hue/version.rb +1 -1
- data/lib/alexa_hue.rb +11 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faac54187d611c92ba6acb601b8af09d05cb92cc
|
4
|
+
data.tar.gz: 43b12f115a8d702872f7805fa5739b7db1b46470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13b99fb1f4a80cc860fe96924e37fb01436104463d2bc800902ebf4c76f25da69bd55c749516b27af758b83b97583d1bb06427520f83cba39a377d3889459afa
|
7
|
+
data.tar.gz: 95b0ded44ded0b12901645833e4deed51a636eeee0a6fefbb8b6c9ec45935be1eaf33d4d4f8e5ec0f99428962381a14327dd4ff1d015f549d1e57b517907cf5d
|
data/lib/alexa_hue/version.rb
CHANGED
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
|
-
|
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
|