Skip to content

Commit

Permalink
Add support for custom templates (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Apr 6, 2023
1 parent 2413a42 commit b5a1fdf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/dialogs/hacs-download-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/data/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type RepositoryCategory =
| "netdaemon"
| "plugin"
| "python_script"
| "template"
| "theme";

export interface RepositoryBase {
Expand Down
1 change: 1 addition & 0 deletions src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"repository": "Repository",
"show": "Show",
"theme": "Theme",
"template": "Template",
"update": "Update",
"updates": "Updates",
"yes": "Yes"
Expand Down
2 changes: 2 additions & 0 deletions src/tools/category-icon.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
mdiCodeBraces,
mdiDotNet,
mdiLanguagePython,
mdiPackageVariant,
Expand All @@ -14,6 +15,7 @@ const _IconMap = {
netdaemon: mdiDotNet,
plugin: mdiViewDashboard,
python_script: mdiLanguagePython,
template: mdiCodeBraces,
theme: mdiPalette,
};

Expand Down

0 comments on commit b5a1fdf

Please sign in to comment.