Codereview fixes.

This commit is contained in:
Dermot Duffy
2023-03-12 15:47:16 -07:00
parent 342d988bbd
commit c053286aa7
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -276,11 +276,13 @@ export class FrigateCameraManagerEngine
// If zone(s) are specified, the master occupancy sensor for the overall // If zone(s) are specified, the master occupancy sensor for the overall
// camera is not used by default (but could be manually added by the // camera is not used by default (but could be manually added by the
// user). // user).
const camerasAndZones = cameraConfig.frigate.zones const camerasAndZones = cameraConfig.frigate.zones?.length
? cameraConfig.frigate.zones ? cameraConfig.frigate.zones
: [cameraConfig.frigate.camera_name]; : [cameraConfig.frigate.camera_name];
const labels = cameraConfig.frigate.labels ? cameraConfig.frigate.labels : ['all']; const labels = cameraConfig.frigate.labels?.length
? cameraConfig.frigate.labels
: ['all'];
for (const cameraOrZone of camerasAndZones) { for (const cameraOrZone of camerasAndZones) {
for (const label of labels) { for (const label of labels) {
addEntityIDIfFound(cameraOrZone, label); addEntityIDIfFound(cameraOrZone, label);
+2 -2
View File
@@ -21,10 +21,10 @@
"frigate": { "frigate": {
"camera_name": "Nome da câmera do Frigate (detectado automaticamente pela entidade)", "camera_name": "Nome da câmera do Frigate (detectado automaticamente pela entidade)",
"client_id": "ID do cliente do Frigate (para >1 servidor Frigate)", "client_id": "ID do cliente do Frigate (para >1 servidor Frigate)",
"label": "", "labels": "",
"editor_label": "Opções do Frigate", "editor_label": "Opções do Frigate",
"url": "URL do servidor Frigate", "url": "URL do servidor Frigate",
"zone": "" "zones": ""
}, },
"go2rtc": { "go2rtc": {
"editor_label": "", "editor_label": "",