mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-22 01:43:29 +01:00
Split registration and app
This commit is contained in:
20
src/register.ts
Normal file
20
src/register.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import config from "./config";
|
||||
import logger from "./logger";
|
||||
import sonos, { bonobService } from "./sonos";
|
||||
|
||||
const bonob = bonobService(
|
||||
config.sonos.serviceName,
|
||||
config.sonos.sid,
|
||||
config.webAddress,
|
||||
"AppLink"
|
||||
);
|
||||
|
||||
const sonosSystem = sonos(config.sonos.deviceDiscovery, config.sonos.seedHost);
|
||||
|
||||
sonosSystem.register(bonob).then((success) => {
|
||||
if (success) {
|
||||
logger.info(
|
||||
`Successfully registered ${bonob.name}(SID:${bonob.sid}) with sonos`
|
||||
);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user