thing-it-device-sonos
Version:
[thing-it-node] Device Plugin for Sonos players.
57 lines (47 loc) • 1.07 kB
JavaScript
/**
* This test file allows to run the basic initiation of the
* HellowWorld class. It does not, however, simulate full
* interaction with the node.
*/
var Sonos = require('../Sonos');
var sonos = Sonos.create({});
sonos.isSimulated = function () {
return false;
};
sonos.configuration = {
simulated: false,
host: "10.0.1.36",
name: "Basement Street",
updateInterval: "10000"
};
sonos.isSimulated = function (){
return sonos.configuration.simulated;
}
sonos.publishEvent = function(event, data){
console.log("Event", event);
};
sonos.publishStateChange = function(){
//console.log("State Change", this.getState());
console.log("State Change");
};
sonos.logInfo = function(){
if (arguments.length == 1 ) {
console.log(arguments[0]);
}
else{
console.log(arguments);
}
}
sonos.logDebug = function(){
sonos.logInfo(arguments);
}
sonos.logError = function(){
sonos.logInfo(arguments);
}
console.log("About to start");
sonos.start();
/*
setTimeout(function () {
sonos.stop();
}, 5000)
*/