add support for sending to ttn2prom

This commit is contained in:
Nico Schottelius 2020-03-12 14:53:50 +01:00
commit 6602000cb7
4 changed files with 39 additions and 3 deletions

View file

@ -13,7 +13,7 @@ import psycopg2.extensions
import sys
import time
import websocket
import requests
logging.basicConfig(format='%(levelname)s: %(message)s')
log = logging.getLogger(__name__)
@ -60,6 +60,16 @@ def nodered_send(path, data):
ws.send("%s" % data)
ws.close()
myobj = {'somekey': 'somevalue'}
def ttn2prom_send(path, data):
url = 'http://localhost:8047/'
x = requests.post(url, data = data)
channels = [ "loriot", "swisscom", "ttn" ]
def pg_conn_notify():