Fix error condition rendering.
This commit is contained in:
+6
-3
@@ -255,7 +255,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
|
||||
*/
|
||||
protected _renderCameraHeader(
|
||||
cameraIndex: number,
|
||||
cameraConfig: RawFrigateCardConfig | undefined,
|
||||
cameraConfig?: RawFrigateCardConfig,
|
||||
addNewCamera?: boolean,
|
||||
): TemplateResult {
|
||||
return html`
|
||||
@@ -275,11 +275,10 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
|
||||
// starting with the most likely to be useful and working our
|
||||
// ways towards the least useful.
|
||||
html` <span>
|
||||
Camera:
|
||||
${cameraConfig?.title ||
|
||||
cameraConfig?.camera_entity ||
|
||||
cameraConfig?.card_id ||
|
||||
[
|
||||
cameraConfig?.camera_entity,
|
||||
cameraConfig?.client_id,
|
||||
cameraConfig?.camera_name,
|
||||
cameraConfig?.label,
|
||||
@@ -771,6 +770,10 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
|
||||
return;
|
||||
}
|
||||
|
||||
if (getConfigValue(this._config, key) === value) {
|
||||
return;
|
||||
}
|
||||
|
||||
const newConfig = copyConfig(this._config);
|
||||
if (value === '' || typeof value === 'undefined') {
|
||||
deleteConfigValue(newConfig, key);
|
||||
|
||||
Reference in New Issue
Block a user