Use media_browser websockets.
This commit is contained in:
+16
-9
@@ -145,12 +145,6 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
|
||||
})}
|
||||
</paper-listbox>
|
||||
</paper-dropdown-menu>
|
||||
<paper-input
|
||||
label="Frigate URL (Required)"
|
||||
.value=${this._config?.frigate_url || ''}
|
||||
.configValue=${'frigate_url'}
|
||||
@value-changed=${this._valueChanged}
|
||||
></paper-input>
|
||||
</div>
|
||||
`
|
||||
: ''}
|
||||
@@ -221,6 +215,12 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
|
||||
})}
|
||||
</paper-listbox>
|
||||
</paper-dropdown-menu>
|
||||
<paper-input
|
||||
label="Frigate client id (Optional, for >1 Frigate server)"
|
||||
.value=${this._config?.frigate_client_id || ''}
|
||||
.configValue=${'frigate_client_id'}
|
||||
@value-changed=${this._valueChanged}
|
||||
></paper-input>
|
||||
<paper-input
|
||||
label="View timeout (seconds)"
|
||||
prevent-invalid-input
|
||||
@@ -231,6 +231,12 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
|
||||
.configValue=${'view_timeout'}
|
||||
@value-changed=${this._valueChanged}
|
||||
></paper-input>
|
||||
<paper-input
|
||||
label="Frigate URL (Optional, for Frigate UI button)"
|
||||
.value=${this._config?.frigate_url || ''}
|
||||
.configValue=${'frigate_url'}
|
||||
@value-changed=${this._valueChanged}
|
||||
></paper-input>
|
||||
<ha-formfield .label=${`Autoplay latest clip`}>
|
||||
<ha-switch
|
||||
.checked=${this._config?.autoplay_clip === true}
|
||||
@@ -341,6 +347,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
|
||||
return;
|
||||
}
|
||||
const target = ev.target;
|
||||
const value = target.value?.trim();
|
||||
let key: string = target.configValue;
|
||||
|
||||
if (!key) {
|
||||
@@ -361,12 +368,12 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
|
||||
key = parts[1];
|
||||
}
|
||||
|
||||
if (target.value !== undefined && objectTarget[key] === target.value) {
|
||||
if (value !== undefined && objectTarget[key] === value) {
|
||||
return;
|
||||
} else if (target.value === '') {
|
||||
} else if (value === '') {
|
||||
delete objectTarget[key];
|
||||
} else {
|
||||
objectTarget[key] = target.checked !== undefined ? target.checked : target.value;
|
||||
objectTarget[key] = target.checked !== undefined ? target.checked : value;
|
||||
}
|
||||
this._config = newConfig;
|
||||
fireEvent(this, 'config-changed', { config: this._config });
|
||||
|
||||
Reference in New Issue
Block a user