-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #519 from svrooij/feature/types
Typescript types
- Loading branch information
Showing
71 changed files
with
5,373 additions
and
603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
const Sonos = require('../') | ||
|
||
console.log('Searching for Sonos devices for 5 seconds...') | ||
console.log('Searching for Sonos devices for 10 seconds...') | ||
|
||
const discovery = new Sonos.AsyncDeviceDiscovery() | ||
|
||
discovery.discover().then((device, model) => { | ||
console.log('Found one sonos device %s getting all groups', device.host) | ||
return device.getAllGroups().then((groups) => { | ||
console.log('Groups %s', JSON.stringify(groups, null, 2)) | ||
return groups[0].CoordinatorDevice().togglePlayback() | ||
// discovery.discover({ port: 50333, timeout: 10000 }).then((device, model) => { | ||
// console.log('Found one sonos device %s getting all groups', device.host) | ||
// return device.getAllGroups().then((groups) => { | ||
// console.log('Groups %s', JSON.stringify(groups, null, 2)) | ||
// //return groups[0].CoordinatorDevice().togglePlayback() | ||
// }) | ||
// }).catch(e => { | ||
// console.warn(' Error in discovery %o', e) | ||
// }) | ||
|
||
discovery.discoverMultiple({ port: 50333, timeout: 10000 }).then((devices) => { | ||
console.log('Found %d sonos devices', devices.length) | ||
devices.forEach(device => { | ||
console.log('Device IP: %s', device.host) | ||
}) | ||
}).catch(e => { | ||
console.warn(' Error in discovery %j', e) | ||
}) | ||
|
||
// discovery.discoverMultiple({ timeout: 5000 }).then((devices) => { | ||
// console.log('Found %d sonos devices', devices.length) | ||
// devices.forEach(device => { | ||
// console.log('Device IP: %s', device.host) | ||
// }) | ||
// }).catch(e => { | ||
// console.warn(' Error in discovery %j', e) | ||
// const discovery = new Sonos.DeviceDiscovery({}, (device, model) => { | ||
// console.log('Found one sonos device %s', device.host) | ||
// process.exit(0); | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.