From 4de0748e670de628d4e4e5cc1a8191b9d760d056 Mon Sep 17 00:00:00 2001 From: Jimmy Shimizu Date: Sun, 4 Jan 2015 17:21:51 +0100 Subject: [PATCH] Added sleep support --- lib/player.js | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/player.js b/lib/player.js index 3fdb5a88..e3297ecd 100644 --- a/lib/player.js +++ b/lib/player.js @@ -890,6 +890,11 @@ Player.prototype.refreshShareIndex = function (callback) { this.soapAction('/MediaServer/ContentDirectory/Control', '"urn:schemas-upnp-org:service:ContentDirectory:1#RefreshShareIndex"', SOAP.RefreshShareIndex, callback); } +Player.prototype.sleep = function (time, callback) { + var soap = SOAP.ConfigureSleepTimer.format({time: time}); + this.soapAction('/MediaRenderer/AVTransport/Control', '"urn:schemas-upnp-org:service:AVTransport:1#ConfigureSleepTimer"', soap, callback); +} + var SOAP = { PositionInfo: '0', Play: '01', @@ -912,7 +917,8 @@ var SOAP = { SetCrossfadeMode: '0{crossfadeMode}', //GetQueue: 'Q:0BrowseDirectChildren{startIndex}{requestedCount}', Browse: '{objectID}BrowseDirectChildren{startIndex}{requestedCount}', - RefreshShareIndex: '' + RefreshShareIndex: '', + ConfigureSleepTimer: '0{time}' }; module.exports = Player; diff --git a/package.json b/package.json index 74f97ac5..bc282cc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sonos-discovery", - "version": "0.13.0", + "version": "0.14.0", "description": "A simple node module for finding players and controlling them", "author": "Jimmy Shimizu ", "repository": {