forked from PSeitz/yamaha-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchainedCommands.js
More file actions
38 lines (30 loc) · 901 Bytes
/
Copy pathchainedCommands.js
File metadata and controls
38 lines (30 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var Promise = require("bluebird");
var xml2js = Promise.promisifyAll(require("xml2js"));
function Yamaha()
{
}
// Navigates and selects the #number of the webradio favorites
Yamaha.prototype.switchToFavoriteNumber = function(favoritelistname, number){
var self = this;
return self.powerOn().then(function(){
self.setMainInputTo("NET RADIO").then( function(){
self.selectWebRadioListItem(1).then(function(){
self.whenMenuReady("NET_RADIO").then(function(){
return self.selectWebRadioListItem(number);
});
});
});
});
};
// unfinished - not working
Yamaha.prototype.switchToWebRadioWithName = function(name){
var self = this;
self.setMainInputTo("NET RADIO").then(function(){
self.getWebRadioList().then(xml2js.parseStringAsync).then(function(result){
console.log(result);
}, function (err) {
console.log("err "+err);
});
});
};
module.exports = Yamaha;