Rename time_pattern trigger to hourly_timer

Renamed the shared time_pattern trigger from "periodic_summary" to
"hourly_timer" since it serves both periodic summary and scheduled
assets features. This makes the trigger's purpose clearer.

Updated all references in should_send_periodic_summary,
should_send_scheduled_assets, and the condition block.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-01 22:29:45 +03:00
parent d8df567d02
commit 369ffe3fb7
2 changed files with 8 additions and 8 deletions

View File

@@ -696,12 +696,12 @@ trigger:
event_type: immich_album_watcher_album_deleted event_type: immich_album_watcher_album_deleted
id: "album_deleted" id: "album_deleted"
# Periodic summary trigger (time pattern) # Hourly timer trigger for periodic summary and scheduled assets
# Note: Uses template to dynamically set interval, but HA requires static value # Note: Uses template to dynamically set interval, but HA requires static value
# so we trigger every hour and check interval in conditions # so we trigger every hour and check interval in conditions
- platform: time_pattern - platform: time_pattern
hours: "/1" hours: "/1"
id: "periodic_summary" id: "hourly_timer"
# Manual trigger for testing periodic summary # Manual trigger for testing periodic summary
# Fire this event from Developer Tools > Events to test periodic summary immediately # Fire this event from Developer Tools > Events to test periodic summary immediately
@@ -1029,7 +1029,7 @@ variables:
# Manual test event (immich_album_watcher_test_periodic_summary) bypasses time check # Manual test event (immich_album_watcher_test_periodic_summary) bypasses time check
# If event data contains automation_id, only matching automations respond # If event data contains automation_id, only matching automations respond
should_send_periodic_summary: > should_send_periodic_summary: >
{% if trigger.id == 'periodic_summary' and enable_periodic_summary %} {% if trigger.id in ['hourly_timer', 'periodic_summary'] and enable_periodic_summary %}
{% if trigger.platform == 'event' and trigger.event.event_type == 'immich_album_watcher_test_periodic_summary' %} {% if trigger.platform == 'event' and trigger.event.event_type == 'immich_album_watcher_test_periodic_summary' %}
{% set event_automation_id = trigger.event.data.automation_id | default('') %} {% set event_automation_id = trigger.event.data.automation_id | default('') %}
{% if event_automation_id | length > 0 %} {% if event_automation_id | length > 0 %}
@@ -1088,7 +1088,7 @@ variables:
{% else %} {% else %}
{{ true }} {{ true }}
{% endif %} {% endif %}
{% elif trigger.id == 'periodic_summary' and enable_scheduled_assets %} {% elif trigger.id == 'hourly_timer' and enable_scheduled_assets %}
{% set current_hour = now().hour %} {% set current_hour = now().hour %}
{% set start = scheduled_assets_start_hour | int %} {% set start = scheduled_assets_start_hour | int %}
{% set interval = scheduled_assets_interval_hours | int %} {% set interval = scheduled_assets_interval_hours | int %}
@@ -1110,14 +1110,14 @@ variables:
# ============================================================================= # =============================================================================
condition: condition:
# Allow through if: # Allow through if:
# 1. Periodic summary trigger and should send periodic summary or scheduled assets # 1. Hourly timer or periodic summary trigger and should send periodic summary or scheduled assets
# 2. Scheduled assets trigger # 2. Scheduled assets trigger (manual test)
# 3. Event trigger and passes all event-based checks # 3. Event trigger and passes all event-based checks
- condition: template - condition: template
value_template: > value_template: >
{% if trigger.id == 'scheduled_assets' %} {% if trigger.id == 'scheduled_assets' %}
{{ should_send_scheduled_assets }} {{ should_send_scheduled_assets }}
{% elif trigger.id == 'periodic_summary' %} {% elif trigger.id in ['hourly_timer', 'periodic_summary'] %}
{{ should_send_periodic_summary or should_send_scheduled_assets }} {{ should_send_periodic_summary or should_send_scheduled_assets }}
{% else %} {% else %}
{{ is_hub_tracked and is_album_tracked and should_notify }} {{ is_hub_tracked and is_album_tracked and should_notify }}

View File

@@ -1,3 +1,3 @@
{ {
"version": "1.22.8" "version": "1.22.9"
} }