Skip to content

Commit 88a8de0

Browse files
hawkeye217NickM-27
andauthored
Miscellaneous Fixes (#21166)
* Improve model titles * remove deprecated strftime_fmt * remove * remove restart wording * add copilot instructions * fix docs * Move files into try for classification rollover * Use friendly names for zones in notifications --------- Co-authored-by: Nicolas Mowen <[email protected]>
1 parent c136e5e commit 88a8de0

File tree

13 files changed

+37
-28
lines changed

13 files changed

+37
-28
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Never write strings in the frontend directly, always write to and reference the relevant translations file.
2+
Always conform new and refactored code to the existing coding style in the project.

docs/docs/configuration/genai/review_summaries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ Along with individual review item summaries, Generative AI provides the ability
116116

117117
Review reports can be requested via the [API](/integrations/api#review-summarization) by sending a POST request to `/api/review/summarize/start/{start_ts}/end/{end_ts}` with Unix timestamps.
118118

119-
For Home Assistant users, there is a built-in service (`frigate.generate_review_summary`) that makes it easy to request review reports as part of automations or scripts. This allows you to automatically generate daily summaries, vacation reports, or custom time period reports based on your specific needs.
119+
For Home Assistant users, there is a built-in service (`frigate.review_summarize`) that makes it easy to request review reports as part of automations or scripts. This allows you to automatically generate daily summaries, vacation reports, or custom time period reports based on your specific needs.

docs/docs/configuration/masks.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ To create a poly mask:
2828
5. Click the plus icon under the type of mask or zone you would like to create
2929
6. Click on the camera's latest image to create the points for a masked area. Click the first point again to close the polygon.
3030
7. When you've finished creating your mask, press Save.
31-
8. Restart Frigate to apply your changes.
3231

3332
Your config file will be updated with the relative coordinates of the mask/zone:
3433

docs/docs/configuration/reference.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,10 +1002,6 @@ ui:
10021002
# full: 8:15:22 PM Mountain Standard Time
10031003
# (default: shown below).
10041004
time_style: medium
1005-
# Optional: Ability to manually override the date / time styling to use strftime format
1006-
# https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html
1007-
# possible values are shown above (default: not set)
1008-
strftime_fmt: "%Y/%m/%d %H:%M"
10091005
# Optional: Set the unit system to either "imperial" or "metric" (default: metric)
10101006
# Used in the UI and in MQTT topics
10111007
unit_system: metric

frigate/comms/webpush.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,20 @@ def send_alert(self, payload: dict[str, Any]) -> None:
390390

391391
message = payload["after"]["data"]["metadata"]["scene"]
392392
else:
393-
title = f"{titlecase(', '.join(sorted_objects).replace('_', ' '))}{' was' if state == 'end' else ''} detected in {titlecase(', '.join(payload['after']['data']['zones']).replace('_', ' '))}"
393+
zone_names = payload["after"]["data"]["zones"]
394+
formatted_zone_names = []
395+
396+
for zone_name in zone_names:
397+
if zone_name in self.config.cameras[camera].zones:
398+
formatted_zone_names.append(
399+
self.config.cameras[camera]
400+
.zones[zone_name]
401+
.get_formatted_name(zone_name)
402+
)
403+
else:
404+
formatted_zone_names.append(titlecase(zone_name.replace("_", " ")))
405+
406+
title = f"{titlecase(', '.join(sorted_objects).replace('_', ' '))}{' was' if state == 'end' else ''} detected in {', '.join(formatted_zone_names)}"
394407
message = f"Detected on {camera_name}"
395408

396409
if ended:

frigate/config/ui.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ class UIConfig(FrigateBaseModel):
3737
time_style: DateTimeStyleEnum = Field(
3838
default=DateTimeStyleEnum.medium, title="Override UI timeStyle."
3939
)
40-
strftime_fmt: Optional[str] = Field(
41-
default=None, title="Override date and time format using strftime syntax."
42-
)
4340
unit_system: UnitSystemEnum = Field(
4441
default=UnitSystemEnum.metric, title="The unit system to use for measurements."
4542
)

frigate/data_processing/real_time/custom_classification.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,14 @@ def write_classification_attempt(
639639
os.makedirs(folder, exist_ok=True)
640640
cv2.imwrite(file, frame)
641641

642-
files = sorted(
643-
filter(lambda f: (f.endswith(".webp")), os.listdir(folder)),
644-
key=lambda f: os.path.getctime(os.path.join(folder, f)),
645-
reverse=True,
646-
)
647-
648642
# delete oldest face image if maximum is reached
649643
try:
644+
files = sorted(
645+
filter(lambda f: (f.endswith(".webp")), os.listdir(folder)),
646+
key=lambda f: os.path.getctime(os.path.join(folder, f)),
647+
reverse=True,
648+
)
649+
650650
if len(files) > max_files:
651651
os.unlink(os.path.join(folder, files[-1]))
652652
except FileNotFoundError:

web/public/locales/en/config/ui.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
"time_style": {
1414
"label": "Override UI timeStyle."
1515
},
16-
"strftime_fmt": {
17-
"label": "Override date and time format using strftime syntax."
18-
},
1916
"unit_system": {
2017
"label": "The unit system to use for measurements."
2118
}
2219
}
23-
}
20+
}

web/public/locales/en/views/classificationModel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"documentTitle": "Classification Models",
2+
"documentTitle": "Classification Models - Frigate",
33
"details": {
44
"scoreInfo": "Score represents the average classification confidence across all detections of this object."
55
},

web/public/locales/en/views/explore.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"millisecondsToOffset": "Milliseconds to offset detect annotations by. <em>Default: 0</em>",
7878
"tips": "Lower the value if the video playback is ahead of the boxes and path points, and increase the value if the video playback is behind them. This value can be negative.",
7979
"toast": {
80-
"success": "Annotation offset for {{camera}} has been saved to the config file. Restart Frigate to apply your changes."
80+
"success": "Annotation offset for {{camera}} has been saved to the config file."
8181
}
8282
}
8383
},

0 commit comments

Comments
 (0)