Add missing cardConfig attribute,

This commit is contained in:
Dermot Duffy
2021-08-09 23:05:09 -07:00
parent 2dfcfabcfc
commit ced89b45a7
3 changed files with 8 additions and 17 deletions
+4 -16
View File
@@ -77,11 +77,11 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
} }
get _name(): string { get _name(): string {
return this._config?.name || ''; return "Frigate";
} }
get _entity(): string { get _camera_entity(): string {
return this._config?.entity || ''; return this._config?.camera_entity || '';
} }
get _show_warning(): boolean { get _show_warning(): boolean {
@@ -92,18 +92,6 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
return this._config?.show_error || false; return this._config?.show_error || false;
} }
get _tap_action(): ActionConfig {
return this._config?.tap_action || { action: 'more-info' };
}
get _hold_action(): ActionConfig {
return this._config?.hold_action || { action: 'none' };
}
get _double_tap_action(): ActionConfig {
return this._config?.double_tap_action || { action: 'none' };
}
protected render(): TemplateResult | void { protected render(): TemplateResult | void {
if (!this.hass || !this._helpers) { if (!this.hass || !this._helpers) {
return html``; return html``;
@@ -132,7 +120,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
@value-changed=${this._valueChanged} @value-changed=${this._valueChanged}
.configValue=${'entity'} .configValue=${'entity'}
> >
<paper-listbox slot="dropdown-content" .selected=${entities.indexOf(this._entity)}> <paper-listbox slot="dropdown-content" .selected=${entities.indexOf(this._camera_entity)}>
${entities.map(entity => { ${entities.map(entity => {
return html` return html`
<paper-item>${entity}</paper-item> <paper-item>${entity}</paper-item>
+2 -1
View File
@@ -1,6 +1,7 @@
// TODO Add material tooltips // TODO Add material tooltips
// TODO Action handlers. // TODO Action handlers.
// TODO Make editor work.
// TODO Try nav popout menu.
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { import {
+2
View File
@@ -21,6 +21,8 @@ export const frigateCardConfigSchema = z.object({
view_timeout: z.number().optional(), view_timeout: z.number().optional(),
label: z.string().optional(), label: z.string().optional(),
// Stock lovelace card config.
type: z.string(),
show_warning: z.boolean().optional(), show_warning: z.boolean().optional(),
show_error: z.boolean().optional(), show_error: z.boolean().optional(),
test_gui: z.boolean().optional(), test_gui: z.boolean().optional(),