-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathcommands.js
21 lines (15 loc) · 1.04 KB
/
commands.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const SonosDevice = require('../lib').SonosDevice
const sonos = new SonosDevice(process.env.SONOS_HOST || '192.168.96.56')
// // Send Play command to AVTransportService (with auto json parsing)
// sonos.ExecuteCommand('AVTransportService.Play', '{"InstanceID": 0, "Speed": "1" }').catch(console.error)
// // Send Play command to AVTransportService
// sonos.ExecuteCommand('AVTransportService.Play', { InstanceID: 0, Speed: '1' }).catch(console.error)
// // Send Pause command to AVTransportService (no parameters)
// sonos.ExecuteCommand('AVTransportService.Pause').catch(console.error)
// // Execute toggle playback
// sonos.ExecuteCommand('TogglePlayback').catch(console.error)
// Execute SwitchToLineIn
sonos.ExecuteCommand('SwitchToQueue').then(console.log).catch(console.error)
// sonos.DevicePropertiesService.GetZoneInfo().then(console.log).catch(console.error)
// sonos.ZoneGroupTopologyService.GetZoneGroupAttributes().then(console.log).catch(console.error)
// sonos.ZoneGroupTopologyService.GetZoneGroupState().then(console.log).catch(console.error)