Fix defaults overriding intentional values.

This commit is contained in:
Dermot Duffy
2023-03-04 10:03:16 -08:00
parent 0b7c2131df
commit 9870446a9f
3 changed files with 29 additions and 18 deletions
+4 -6
View File
@@ -1063,16 +1063,14 @@ class FrigateCard extends LitElement {
this._cardWideConfig,
);
// For each camera merge the config into the camera global config. The
// merging must happen in this order, to ensure that the defaults in the
// cameras global config do not override the values specified in the
// per-camera config.
// For each camera merge the config (which has no defaults) into the camera
// global config (which does have defaults). The merging must happen in this
// order, to ensure that the defaults in the cameras global config do not
// override the values specified in the per-camera config.
const cameras = config.cameras.map((camera) =>
merge(cloneDeep(config.cameras_global), camera),
);
console.info("MERGED CAMERAS", cameras);
try {
await this._cameraManager.initializeCameras(
hass,