Detail the event data for folder_watcher (#22427)

This commit is contained in:
Edward 2022-06-29 14:52:35 +10:00 committed by GitHub
parent a5bc04ee3c
commit c06a21f009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,17 @@ folder_watcher:
## Automations
The elements the events contain are:
- `event_type`: matching the `event_type` of the filter (one of `created`, `moved`, `modified`, `deleted`, `closed`)
- `path`: The full path to the file (e.g. "/hello/world.txt")
- `file`: The name of the file (e.g. "world.txt")
- `folder`: The folder path (e.g. "/hello")
When the `event_type` is `moved`, the file details are for the source file and destination details are included:
- `dest_path`: The full path to the moved file (e.g. "/hello/world.txt")
- `dest_file`: The name of the moved file (e.g. "world.txt")
- `dest_folder`: The folder moved path (e.g. "/hello")
Automations can be triggered on filesystem event data using a template. The following automation will send a notification with the name and folder of new files added to that folder:
{% raw %}