alexa_remotectl 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/alexa_remotectl.rb +37 -4
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee085eb3e18299edb7c08f01ca1eac8f90ca30f6cc125b64deb18ff9af848662
|
4
|
+
data.tar.gz: 48225e18ed743504662f52f6abd3ba17bad63fa3035bfb04a29a85b1d176a0a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efbd977b60c72d374cb8b3f7864030dc772fbd1fb6369e3a5ee74f1dc7ba41276c2df2b2640b983deccad8273a8a1cf6ca26237a60b72fc59e61cb489bac5a42
|
7
|
+
data.tar.gz: 2e40d366bb49d53f9808117034cfa87c276d4ddb212ee321320ce9f9dc7ead6a50db66e3f88b341a505ad322e0aee045f6a495162508fd105d79bfd37b4d9b33
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/alexa_remotectl.rb
CHANGED
@@ -13,7 +13,7 @@ require 'json'
|
|
13
13
|
# Use the CodeWizard with the cURL command you've copied using Developer
|
14
14
|
# tools on Alexa's SPA page (within the web browser).
|
15
15
|
#
|
16
|
-
# note: to find the correct url to convert, try
|
16
|
+
# note: to find the correct url to convert, try clicking on pause or play to
|
17
17
|
# invoke an AJAX request
|
18
18
|
|
19
19
|
class CodeWizard
|
@@ -70,13 +70,29 @@ class AlexaRemoteCtl
|
|
70
70
|
|
71
71
|
end
|
72
72
|
|
73
|
+
# Some audio streams can't be paused through the SPA API. Playing a
|
74
|
+
# historical queue, and then pausing it, is the best next option.
|
75
|
+
#
|
76
|
+
def force_pause()
|
77
|
+
|
78
|
+
r = list_hq()
|
79
|
+
queueid = r[:media][0][:queueId]
|
80
|
+
|
81
|
+
play_hq queueid
|
82
|
+
sleep 1
|
83
|
+
|
84
|
+
pause()
|
85
|
+
|
86
|
+
end
|
87
|
+
|
73
88
|
def info()
|
74
89
|
device_player()[:playerInfo]
|
75
90
|
end
|
76
91
|
|
77
92
|
def list_ebooks()
|
78
|
-
get_json '/api/ebooks/library', "mediaOwnerCustomerId=#{@customerid}" +
|
93
|
+
r = get_json '/api/ebooks/library', "mediaOwnerCustomerId=#{@customerid}" +
|
79
94
|
"&nextToken=&size=50"
|
95
|
+
r[:metadataList]
|
80
96
|
end
|
81
97
|
|
82
98
|
# list historical queue (hq)
|
@@ -104,7 +120,13 @@ class AlexaRemoteCtl
|
|
104
120
|
pp_cmd('Play')
|
105
121
|
end
|
106
122
|
|
107
|
-
def play_ebook(
|
123
|
+
def play_ebook(obj)
|
124
|
+
|
125
|
+
id = if obj.is_a? Integer then
|
126
|
+
list_ebook()[obj][:asin]
|
127
|
+
else
|
128
|
+
obj
|
129
|
+
end
|
108
130
|
|
109
131
|
serialno = @device[:serialno]
|
110
132
|
type = @device[:type]
|
@@ -125,7 +147,15 @@ class AlexaRemoteCtl
|
|
125
147
|
# play historical queue
|
126
148
|
# note: You can find the queueid from an entry in the list_hq() result
|
127
149
|
#
|
128
|
-
def play_hq(
|
150
|
+
def play_hq(obj)
|
151
|
+
|
152
|
+
queueid = if obj.is_a? Integer then
|
153
|
+
r = list_hq()
|
154
|
+
r[:media][obj][:queueId]
|
155
|
+
else
|
156
|
+
obj
|
157
|
+
end
|
158
|
+
|
129
159
|
device_phq(queueid)
|
130
160
|
end
|
131
161
|
|
@@ -164,6 +194,8 @@ class AlexaRemoteCtl
|
|
164
194
|
device_cmd(body)
|
165
195
|
end
|
166
196
|
|
197
|
+
alias setvol vol=
|
198
|
+
|
167
199
|
private
|
168
200
|
|
169
201
|
# play, pause, or next
|
@@ -310,6 +342,7 @@ class AlexaDevices
|
|
310
342
|
|
311
343
|
end
|
312
344
|
|
345
|
+
def force_pause(id) invoke(:force_pause, id) end
|
313
346
|
def info(id=nil) invoke(:info, id) end
|
314
347
|
def list_ebooks(id) invoke(:list_ebooks, id) end
|
315
348
|
def list_hq(id=nil) invoke(:list_hq, id) end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|