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

21
actions/hello.py Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""
Hello Action - Python Example Pack
A minimal Python action that returns "Hello, Python".
Demonstrates the basic structure of a Python action in Attune.
"""
import json
import sys
def run(**kwargs):
"""Return a simple greeting message."""
return {"message": "Hello, Python"}
if __name__ == "__main__":
result = run()
print(json.dumps({"result": result, "status": "success"}))
sys.exit(0)