diff --git a/.cspell/frigate-dictionary.txt b/.cspell/frigate-dictionary.txt index 77e4ede62..e9405c9f7 100644 --- a/.cspell/frigate-dictionary.txt +++ b/.cspell/frigate-dictionary.txt @@ -264,6 +264,7 @@ tensorrt tflite thresholded timelapse +titlecase tmpfs tobytes toggleable diff --git a/docker/main/requirements-wheels.txt b/docker/main/requirements-wheels.txt index 4ab7e03e6..2764eca43 100644 --- a/docker/main/requirements-wheels.txt +++ b/docker/main/requirements-wheels.txt @@ -31,6 +31,7 @@ norfair == 2.2.* setproctitle == 1.3.* ws4py == 0.5.* unidecode == 1.3.* +titlecase == 2.4.* # Image Manipulation numpy == 1.26.* opencv-python-headless == 4.11.0.* diff --git a/frigate/comms/webpush.py b/frigate/comms/webpush.py index 47b0bafc7..c825c0617 100644 --- a/frigate/comms/webpush.py +++ b/frigate/comms/webpush.py @@ -12,6 +12,7 @@ from typing import Any, Callable from py_vapid import Vapid01 from pywebpush import WebPusher +from titlecase import titlecase from frigate.comms.base_communicator import Communicator from frigate.comms.config_updater import ConfigSubscriber @@ -325,8 +326,8 @@ class WebPushClient(Communicator): # type: ignore[misc] sorted_objects.update(payload["after"]["data"]["sub_labels"]) - title = f"{', '.join(sorted_objects).replace('_', ' ').title()}{' was' if state == 'end' else ''} detected in {', '.join(payload['after']['data']['zones']).replace('_', ' ').title()}" - message = f"Detected on {camera.replace('_', ' ').title()}" + title = f"{titlecase(', '.join(sorted_objects).replace('_', ' '))}{' was' if state == 'end' else ''} detected in {titlecase(', '.join(payload['after']['data']['zones']).replace('_', ' '))}" + message = f"Detected on {titlecase(camera.replace('_', ' '))}" image = f"{payload['after']['thumb_path'].replace('/media/frigate', '')}" # if event is ongoing open to live view otherwise open to recordings view