Skip to content

Commit

Permalink
utilise regex instead of rstrip (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtBatten authored Aug 4, 2023
1 parent 70d528a commit 3530255
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 3530255

Please sign in to comment.