Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utilise regex instead of rstrip #70

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Frigate Camera Notifications/Beta
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ blueprint:
mode: parallel
trigger_variables:
input_camera: !input camera
camera: "{{ input_camera.rstrip('_1').rstrip('_2').rstrip('_3') | replace('camera.', '') }}"
camera: "{{ input_camera | regex_replace('^camera\.|_\d+$', '') }}"
mqtt_topic: !input mqtt_topic
trigger:
- platform: event
Expand All @@ -694,7 +694,7 @@ trigger:
id: frigate-event
variables:
input_camera: !input camera
camera: "{{ input_camera | replace('camera.', '') }}"
camera: "{{ input_camera | regex_replace('^camera\.', '') }}"
camera_name: "{{ camera | replace('_', ' ') | title }}"
input_base_url: !input base_url
base_url: "{{ input_base_url.rstrip('/')}}"
Expand All @@ -705,7 +705,7 @@ variables:
update_thumbnail: !input update_thumbnail
ios_live_view: !input ios_live_view
group: !input notify_group
group_target: "{{ group | lower | replace('notify.', '') | replace(' ','_') }}"
group_target: "{{ group | lower | regex_replace('^notify\.', '') | replace(' ','_') }}"
zone_only: !input zone_filter
input_zones: !input zones
zones: "{{ input_zones | list | lower }}"
Expand Down