mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-22 09:53:32 +01:00
When running bonob outside of sonos network ability to register with sonos using remote bonob
This commit is contained in:
14
src/app.ts
14
src/app.ts
@@ -67,6 +67,10 @@ const app = server(
|
||||
true,
|
||||
);
|
||||
|
||||
app.listen(config.port, () => {
|
||||
logger.info(`Listening on ${config.port} available @ ${config.bonobUrl}`);
|
||||
});
|
||||
|
||||
if (config.sonos.autoRegister) {
|
||||
sonosSystem.register(bonob).then((success) => {
|
||||
if (success) {
|
||||
@@ -75,10 +79,12 @@ if (config.sonos.autoRegister) {
|
||||
);
|
||||
}
|
||||
});
|
||||
} else if(config.sonos.deviceDiscovery) {
|
||||
sonosSystem.devices().then(devices => {
|
||||
devices.forEach(d => {
|
||||
logger.info(`Found device ${d.name}(${d.group}) @ ${d.ip}:${d.port}`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
app.listen(config.port, () => {
|
||||
logger.info(`Listening on ${config.port} available @ ${config.bonobUrl}`);
|
||||
});
|
||||
|
||||
export default app;
|
||||
|
||||
Reference in New Issue
Block a user