Add mock admin tools

This commit is contained in:
Adrian Jagielak
2025-07-22 00:51:14 +02:00
parent ba1be7766c
commit 5d687f90e6
3 changed files with 59 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import { v4 as uuid } from "uuid";
import { connectHub, connectHA } from "./client";
import { publishDiscovery } from "./discovery";
import { exposeSmarthubTools } from "./admin";
(async () => {
const hubIp = process.env.FH_HUB_IP || "";
@@ -30,6 +31,8 @@ import { publishDiscovery } from "./discovery";
const fimp = await connectHub({ hubIp, username: hubUsername, password: hubPassword });
console.log("Connected to Futurehome hub");
exposeSmarthubTools(ha, fimp);
// -- subscribe to FIMP events -----------------------------------------
fimp.subscribe("#");
fimp.on("message", (topic, buf) => {