diff --git a/script/gulp/rollup.js b/script/gulp/rollup.js index 0b085f4ab..6a676cafe 100644 --- a/script/gulp/rollup.js +++ b/script/gulp/rollup.js @@ -82,7 +82,8 @@ const outputconfig = (isDev) => { entryFileNames: !isDev ? "[name]-[hash].js" : "[name]-dev.js", format: "es", intro: `const __DEMO__ = false; - const __SUPERVISOR__ = true`, + const __SUPERVISOR__ = true; + const __BUILD__ = "latest"`, }; }; diff --git a/src/components/dialogs/hacs-custom-repositories-dialog.ts b/src/components/dialogs/hacs-custom-repositories-dialog.ts index 7fce2a7bf..d087ed937 100644 --- a/src/components/dialogs/hacs-custom-repositories-dialog.ts +++ b/src/components/dialogs/hacs-custom-repositories-dialog.ts @@ -41,17 +41,20 @@ export class HacsCustomRepositoriesDialog extends HacsDialogBase { if (!this.active) return html``; const addRepositorySchema: HaFormSchema[] = [ { - type: "string", name: "repository", + selector: { text: {} }, }, { - type: "select", name: "category", - optional: true, - options: this.hacs.configuration.categories.map((category) => [ - category, - this.hacs.localize(`common.${category}`), - ]), + selector: { + select: { + mode: "dropdown", + options: this.hacs.configuration.categories.map((category) => ({ + value: category, + label: this.hacs.localize(`common.${category}`), + })), + }, + }, }, ]; return html` diff --git a/src/components/dialogs/hacs-download-dialog.ts b/src/components/dialogs/hacs-download-dialog.ts index 752881064..3a909f732 100644 --- a/src/components/dialogs/hacs-download-dialog.ts +++ b/src/components/dialogs/hacs-download-dialog.ts @@ -98,25 +98,25 @@ export class HacsDonwloadDialog extends HacsDialogBase { const donwloadRepositorySchema: HaFormSchema[] = [ { - type: "boolean", name: "beta", + selector: { boolean: {} }, }, { - type: "select", name: "version", - optional: true, - //@ts-ignore - options: - this._repository.version_or_commit === "version" - ? this._repository.releases - .map((version) => [version, version]) - .concat( - this._repository.full_name === "hacs/integration" || - this._repository.hide_default_branch - ? [] - : [[this._repository.default_branch, this._repository.default_branch]] - ) - : [], + selector: { + select: { + options: + this._repository.version_or_commit === "version" + ? this._repository.releases.concat( + this._repository.full_name === "hacs/integration" || + this._repository.hide_default_branch + ? [] + : [this._repository.default_branch] + ) + : [], + mode: "dropdown", + }, + }, }, ]; return html` diff --git a/src/hacs-resolver.ts b/src/hacs-resolver.ts index 6080ee076..06b08f288 100644 --- a/src/hacs-resolver.ts +++ b/src/hacs-resolver.ts @@ -33,23 +33,23 @@ import { navigate } from "../homeassistant-frontend/src/common/navigate"; @customElement("hacs-resolver") export class HacsResolver extends LitElement { - @property({ attribute: false }) public configuration: Configuration; + @property({ attribute: false }) public configuration!: Configuration; @property({ attribute: false }) public critical!: Critical[]; @property({ attribute: false }) public hass!: HomeAssistant; - @property({ attribute: false }) public lovelace: LovelaceResource[]; + @property({ attribute: false }) public lovelace!: LovelaceResource[] | null; @property({ type: Boolean }) public narrow!: boolean; - @property({ attribute: false }) public repositories: Repository[]; + @property({ attribute: false }) public repositories!: Repository[]; @property({ attribute: false }) public route!: Route; - @property({ attribute: false }) public status: Status; + @property({ attribute: false }) public status!: Status; - @property({ attribute: false }) public removed: RemovedRepository[]; + @property({ attribute: false }) public removed!: RemovedRepository[]; @query("#hacs-dialog") private _hacsDialog?: any; @@ -81,17 +81,11 @@ export class HacsResolver extends LitElement { }; /* Backend event subscription */ - this.hass.connection.subscribeEvents(async () => await this._updateProperties(), "hacs/config"); - this.hass.connection.subscribeEvents(async () => await this._updateProperties(), "hacs/status"); + this.hass.connection.subscribeEvents(async () => this._updateProperties(), "hacs/config"); + this.hass.connection.subscribeEvents(async () => this._updateProperties(), "hacs/status"); - this.hass.connection.subscribeEvents( - async () => await this._updateProperties(), - "hacs/repository" - ); - this.hass.connection.subscribeEvents( - async () => await this._updateProperties(), - "lovelace_updated" - ); + this.hass.connection.subscribeEvents(async () => this._updateProperties(), "hacs/repository"); + this.hass.connection.subscribeEvents(async () => this._updateProperties(), "lovelace_updated"); await this._updateProperties(); } @@ -184,7 +178,7 @@ export class HacsResolver extends LitElement { } private _setRoute(ev: LocationChangedEvent): void { - this.route = ev.detail.route; + this.route = ev.detail!.route; navigate(this.route.prefix + this.route.path); this.requestUpdate(); }