From b5a1fdf91fdb74bdfa58ea68191cad6a85d3924d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Thu, 6 Apr 2023 10:36:18 +0200 Subject: [PATCH] Add support for custom templates (#646) --- src/components/dialogs/hacs-download-dialog.ts | 2 +- src/data/repository.ts | 1 + src/localize/languages/en.json | 1 + src/tools/category-icon.ts | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/dialogs/hacs-download-dialog.ts b/src/components/dialogs/hacs-download-dialog.ts index be1c333b..d2f4d579 100644 --- a/src/components/dialogs/hacs-download-dialog.ts +++ b/src/components/dialogs/hacs-download-dialog.ts @@ -61,7 +61,7 @@ export class HacsDonwloadDialog extends HacsDialogBase { private _getInstallPath = memoizeOne((repository: RepositoryBase) => { let path: string = repository.local_path; - if (repository.category === "theme") { + if (["template", "theme"].includes(repository.category)) { path = `${path}/${repository.file_name}`; } return path; diff --git a/src/data/repository.ts b/src/data/repository.ts index 8b816d81..3e76cc15 100644 --- a/src/data/repository.ts +++ b/src/data/repository.ts @@ -6,6 +6,7 @@ export type RepositoryCategory = | "netdaemon" | "plugin" | "python_script" + | "template" | "theme"; export interface RepositoryBase { diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index b6ca9b0a..81992a6c 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -20,6 +20,7 @@ "repository": "Repository", "show": "Show", "theme": "Theme", + "template": "Template", "update": "Update", "updates": "Updates", "yes": "Yes" diff --git a/src/tools/category-icon.ts b/src/tools/category-icon.ts index ca3c1cfb..2f028440 100644 --- a/src/tools/category-icon.ts +++ b/src/tools/category-icon.ts @@ -1,4 +1,5 @@ import { + mdiCodeBraces, mdiDotNet, mdiLanguagePython, mdiPackageVariant, @@ -14,6 +15,7 @@ const _IconMap = { netdaemon: mdiDotNet, plugin: mdiViewDashboard, python_script: mdiLanguagePython, + template: mdiCodeBraces, theme: mdiPalette, };