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:
21
actions/hello.py
Normal file
21
actions/hello.py
Normal 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)
|
||||
Reference in New Issue
Block a user