Gallery: add prune button (behold 100), webhook automation, shell_command
This commit is contained in:
@@ -1,3 +1,16 @@
|
||||
- alias: 'Indkorsel: Slet gamle snapshots (behold 100)'
|
||||
description: Køres via webhook fra galleriet – sletter alle undtagen de 100 nyeste snapshots og regenererer galleriet.
|
||||
trigger:
|
||||
- platform: webhook
|
||||
webhook_id: indkorsel_prune_100
|
||||
allowed_methods: [POST]
|
||||
local_only: true
|
||||
action:
|
||||
- action: shell_command.indkorsel_prune_keep_100
|
||||
- delay: '00:00:02'
|
||||
- action: shell_command.indkorsel_generate_gallery
|
||||
mode: single
|
||||
|
||||
- alias: 'Snapshot ved person i indkorsel'
|
||||
description: >
|
||||
Gemmer et tidsstemplet snapshot + opdaterer latest.jpg + regenererer HTML-galleri,
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
indkorsel_generate_gallery: "/usr/local/bin/docker exec homeassistant python3 /config/python_scripts/generate_indkorsel_gallery.py"
|
||||
indkorsel_prune_keep_100: "ls -1 /config/www/snapshots/indkorsel/*.jpg | grep -v '/latest.jpg$' | sort -r | tail -n +101 | xargs rm -f"
|
||||
|
||||
Reference in New Issue
Block a user