Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 32a05a0

Browse files
committed
Fri Apr 19 20:47:30 PDT 2024
1 parent cc47599 commit 32a05a0

7 files changed

Lines changed: 31 additions & 9 deletions

File tree

ollama/icon.png

7.31 KB
Loading

server/Dockerfile.addon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ LABEL \
5252
org.opencontainers.image.revision=${BUILD_REF} \
5353
org.opencontainers.image.version=${BUILD_VERSION}
5454

55-
CMD ["bashio", "/usr/src/app/server/hass-entrypoint.sh"]
55+
CMD ["bun", "run", "/usr/src/app/server/src/index.ts"]

server/hass-entrypoint.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

server/logo.png

15.1 KB
Loading

server/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { injectHassOptions } from './services/hass'
2+
await injectHassOptions()
3+
14
import { Elysia } from 'elysia'
25
import { swagger } from './services/swagger'
36
import { autoload } from "elysia-autoload"

server/src/services/hass.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { exists, readFile } from 'fs/promises'
2+
3+
const OPTIONS_PATH = '/data/options.json'
4+
5+
export const injectHassOptions = async () => {
6+
const isHass = await exists(OPTIONS_PATH)
7+
if (!isHass) {
8+
return
9+
}
10+
11+
const raw = await readFile(OPTIONS_PATH, 'utf8')
12+
const options = JSON.parse(raw)
13+
14+
if (options.llm) {
15+
process.env.LLM = JSON.stringify(options.llm)
16+
}
17+
18+
if (options.embeddings) {
19+
process.env.EMBEDDINGS = JSON.stringify(options.embeddings)
20+
}
21+
22+
process.env.HOMEASSISTANT = JSON.stringify({
23+
"token": process.env.SUPERVISOR_TOKEN,
24+
"url": "ws://supervisor/core/websocket",
25+
})
26+
}

skills/homeassistant/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createAssistant, type ToolInterface } from '@ava/lang'
1+
import { type ToolInterface } from '@ava/lang'
22
import { entities } from './tools/entities'
33
import { call, services } from './tools/services'
44

0 commit comments

Comments
 (0)