2016-02-16 17:42:01 +01:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import pyalfred
|
|
|
|
import requests
|
|
|
|
|
|
|
|
CONFIG = {
|
|
|
|
"api_url": "https://monitoring.freifunk-franken.de/api/alfred",
|
|
|
|
"fetch_ids": [64]
|
|
|
|
}
|
|
|
|
|
|
|
|
ac = pyalfred.AlfredConnection()
|
|
|
|
|
|
|
|
for req_data_type in CONFIG["fetch_ids"]:
|
|
|
|
data = {req_data_type: ac.fetch(req_data_type)}
|
2016-02-17 02:47:13 +01:00
|
|
|
response = requests.post(CONFIG["api_url"], json=data)
|
|
|
|
response.raise_for_status()
|
|
|
|
for data_type, data in response.json().items():
|
2016-02-16 17:42:01 +01:00
|
|
|
ac.send(int(data_type), data)
|