Add autoplay clip configuration.

This commit is contained in:
Dermot Duffy
2021-08-20 21:37:22 -07:00
parent 2cf3fc21db
commit eecb1a2a6c
3 changed files with 23 additions and 6 deletions
+8 -5
View File
@@ -205,6 +205,13 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
.configValue=${'view_timeout'}
@value-changed=${this._valueChanged}
></paper-input>
<ha-formfield .label=${`Autoplay clip`}>
<ha-switch
.checked=${this._config?.autoplay_clip !== false}
.configValue=${'autoplay_clip'}
@change=${this._valueChanged}
></ha-switch>
</ha-formfield>
</div>`
: ''}
<div class="option" @click=${this._toggleOption} .option=${'advanced'}>
@@ -309,8 +316,6 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
}
const target = ev.target;
let key: string = target.configValue;
console.log(target);
console.log(target.value);
if (!key) {
return;
@@ -329,10 +334,8 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
objectTarget = newConfig[configName];
key = parts[1];
}
//console.log(`Value is: ${target.value}`);
//return;
if (objectTarget[key] === target.value) {
if (target.value !== undefined && objectTarget[key] === target.value) {
return;
} else if (target.value === '') {
delete objectTarget[key];