Skip to content

Commit

Permalink
fix: use Deno.env as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoim committed Jan 8, 2023
1 parent d2d6d40 commit 733a183
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions reactive_home/src/hass/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ import {
let { HASS_URL, HASS_LONG_LIVED_TOKEN } = dotenvConfig();

if (!HASS_URL) {
HASS_URL = await CliffyInput.prompt("Hass url:");
HASS_URL =
Deno.env.get("HASS_URL") ?? (await CliffyInput.prompt("Hass url:"));
}

if (!HASS_LONG_LIVED_TOKEN) {
HASS_LONG_LIVED_TOKEN = await CliffyInput.prompt("Hass long lived token:");
HASS_LONG_LIVED_TOKEN =
Deno.env.get("HASS_LONG_LIVED_TOKEN") ??
(await CliffyInput.prompt("Hass long lived token:"));
}

export const url = HASS_URL;
Expand Down

0 comments on commit 733a183

Please sign in to comment.