mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-22 01:43:29 +01:00
Add simple listing of sonos devices and basic Dockefile for running it
This commit is contained in:
20
src/music_service.ts
Normal file
20
src/music_service.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import axios from "axios";
|
||||
import { Md5 } from "ts-md5/dist/md5";
|
||||
|
||||
const s = "foobar100";
|
||||
const navidrome = process.env["BONOB_NAVIDROME_URL"];
|
||||
const u = process.env["BONOB_USER"];
|
||||
const t = Md5.hashStr(`${process.env["BONOB_PASSWORD"]}${s}`);
|
||||
|
||||
export class Navidrome {
|
||||
ping = (): Promise<boolean> =>
|
||||
axios
|
||||
.get(
|
||||
`${navidrome}/rest/ping.view?u=${u}&t=${t}&s=${s}&v=1.16.1.0&c=myapp`
|
||||
)
|
||||
.then((_) => true)
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user