fixup! adding ha addon support

This commit is contained in:
Gianmarco Pettinato 2024-01-29 14:00:47 +01:00
parent 96b91f85a2
commit e69e10de27

View File

@ -15,6 +15,8 @@ async function run() {
} }
HA_MIDDLEWARE = await HAMiddleware.getInstance({ HA_MIDDLEWARE = await HAMiddleware.getInstance({
host: 'supervisor', host: 'supervisor',
port: 80,
path: '/core/websocket',
token, token,
}); });
BRIDGE = getBridge(); BRIDGE = getBridge();
@ -22,7 +24,11 @@ async function run() {
BRIDGE.start(); BRIDGE.start();
} }
run().then().catch(LOGGER.error); run()
.then()
.catch((error) => {
LOGGER.error(JSON.stringify(error));
});
process.on('SIGINT', () => { process.on('SIGINT', () => {
HA_MIDDLEWARE.stop(); HA_MIDDLEWARE.stop();