Initial commit: Python Example Pack for Attune

Includes:
- 3 Python actions (hello, http_example, read_counter)
- 1 counter trigger type
- 1 counter sensor (Python, keystore-backed, per-rule state)
- 1 example rule (count_and_log)
- requirements.txt with requests and pika
- README with full usage documentation
This commit is contained in:
2026-02-11 08:18:43 -06:00
commit f3c159913e
15 changed files with 1306 additions and 0 deletions

25
rules/count_and_log.yaml Normal file
View File

@@ -0,0 +1,25 @@
# Count and Log Rule
# Connects the counter sensor trigger to the read_counter action
#
# When the counter sensor fires, this rule passes the counter value
# and rule reference from the trigger payload into the read_counter action.
ref: python_example.count_and_log
pack_ref: python_example
label: "Count and Log"
description: "Fires on each counter tick and logs the current counter value"
# Link trigger to action
trigger_ref: python_example.counter
action_ref: python_example.read_counter
# Map trigger payload fields into action parameters
action_params:
counter: "{{ trigger.payload.counter }}"
rule_ref: "{{ trigger.payload.rule_ref }}"
# No conditions — fire on every counter event
conditions: {}
# Active by default
enabled: true