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
22 lines
440 B
Python
22 lines
440 B
Python
#!/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)
|