Skip to content

Commit a1e4698

Browse files
committed
Add NightMode and SpeechEnhancement endpoints
Identify SUBs correctly on PLAYBARs
1 parent 7d22fa7 commit a1e4698

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ The actions supported as of today:
9797
* clipall
9898
* join / leave (Grouping actions)
9999
* sub (on/off/gain/crossover/polarity) See SUB section for more info
100+
* nightmode (on/off, PLAYBAR only)
101+
* speechenhancement (on/off, PLAYBAR only)
102+
100103

101104
State
102105
-----

lib/actions/equalizer.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
3+
function nightMode(player, values) {
4+
const enable = values[0] === 'on';
5+
return player.nightMode(enable);
6+
}
7+
8+
function speechEnhancement(player, values) {
9+
const enable = values[0] === 'on';
10+
return player.speechEnhancement(enable);
11+
}
12+
13+
module.exports = function (api) {
14+
api.registerAction('nightmode', nightMode);
15+
api.registerAction('speechenhancement', speechEnhancement);
16+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sonos-http-api",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44
"description": "A simple node app for controlling a Sonos system with basic HTTP requests",
55
"scripts": {
66
"start": "node server.js"
@@ -18,7 +18,7 @@
1818
"json5": "^0.5.1",
1919
"node-static": "~0.7.0",
2020
"request-promise": "~1.0.2",
21-
"sonos-discovery": "https://github.com/jishi/node-sonos-discovery/archive/v1.3.2.tar.gz"
21+
"sonos-discovery": "https://github.com/jishi/node-sonos-discovery/archive/v1.4.0.tar.gz"
2222
},
2323
"engines": {
2424
"node": ">=4.0.0",

0 commit comments

Comments
 (0)