Skip to content

Commit

Permalink
Get WS_URL from ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
bokub committed Dec 23, 2023
1 parent 4f4f494 commit 9c96185
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { auth } from 'home-assistant-js-websocket/dist/messages.js';
import { debug, warn } from './log.js';
import dayjs from 'dayjs';

const WS_URL = 'ws://supervisor/core/websocket';
const WS_URL = process.env.WS_URL || 'ws://supervisor/core/websocket';
const TOKEN = process.env.SUPERVISOR_TOKEN;

export type SuccessMessage = {
id: string;
Expand Down Expand Up @@ -62,7 +63,7 @@ export class HomeAssistantClient {
}
});

connection.sendUTF(JSON.stringify(auth(process.env.SUPERVISOR_TOKEN)));
connection.sendUTF(JSON.stringify(auth(TOKEN)));
}
});
});
Expand Down

0 comments on commit 9c96185

Please sign in to comment.