When running bonob outside of sonos network ability to register with sonos using remote bonob

This commit is contained in:
simojenki
2021-08-06 18:12:55 +10:00
parent 22b8bf76d2
commit 27dc933ee0
8 changed files with 95 additions and 40 deletions

View File

@@ -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;