Disabled sonos should return false for all mutations

This commit is contained in:
simojenki
2021-09-21 11:15:51 +10:00
parent a0043668d2
commit 0bc2d39a37
7 changed files with 60 additions and 41 deletions

View File

@@ -1,15 +1,12 @@
import axios from "axios";
import _ from "underscore";
import logger from "./logger";
import sonos, { bonobService, Discovery } from "./sonos";
import sonos, { bonobService } from "./sonos";
import { URLBuilder } from "./url_builder";
export default (
bonobUrl: URLBuilder,
sonosDiscovery: Discovery = {
auto: true,
seedHost: undefined,
}
seedHost?: string
) =>
async () => {
const about = bonobUrl.append({ pathname: "/about" });
@@ -34,5 +31,5 @@ export default (
.then(({ name, sid }: { name: string; sid: number }) =>
bonobService(name, sid, bonobUrl)
)
.then((service) => sonos(sonosDiscovery).register(service));
.then((service) => sonos({ enabled: true, seedHost }).register(service));
};