Skip to content

Commit 4a76ed2

Browse files
author
Stephan van Rooij
committed
fix: Send notification to all groups
1 parent 0a86236 commit 4a76ed2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ To play a short music file as a notification send the following payload to `sono
222222
}
223223
```
224224

225-
You can also have a notification play on all speakers, just send the following message to `sonos/cmd/notify`.
225+
You can also have a notification play on all groups (all devices that coordinate themself), just send the following message to `sonos/cmd/notify`.
226226

227227
```JSON
228228
{

src/sonos-to-mqtt.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ export class SonosToMqtt {
6363
this.log.debug('Got generic command {command} from mqtt', command)
6464
switch (command) {
6565
case 'notify':
66-
return Promise.all(this.sonosManager.Devices.map(d => d.PlayNotification(payload)))
66+
return Promise.all(this.sonosManager.Devices
67+
.filter(d => d.Coordinator.Uuid === d.Uuid)
68+
.map(d => d.PlayNotification(payload))
69+
)
6770
case 'pauseall':
6871
return Promise.all(this.sonosManager.Devices.map(d => d.Pause()));
6972
case 'listalarm':

0 commit comments

Comments
 (0)