From ca3641641f7166140f9f172c34186c5cd370e02c Mon Sep 17 00:00:00 2001 From: kolossos Date: Fri, 15 Jan 2021 19:53:47 +0100 Subject: [PATCH] +hiveeeyes --- src/weight-datageneration.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/weight-datageneration.py b/src/weight-datageneration.py index e982ab6..47304b7 100644 --- a/src/weight-datageneration.py +++ b/src/weight-datageneration.py @@ -5,6 +5,8 @@ myScale = nau7802py.NAU7802() grafanaurl="%GRAFANA_URL%" +hiveeyesurl="https://swarm.hiveeyes.org/api/hiveeyes/Kryvle/Zietenaugust/" + if myScale.begin(): while True: currentReading = myScale.getReading() @@ -18,3 +20,11 @@ if myScale.begin(): print("no access to grafana?") pass time.sleep(1) + try: + cmd="curl --header \"Content-Type: application/json\" -XPOST -d '{\"weight\": "+str(currentWeight)+"}' "+hiveeyesurl+"Beute2/data" + print (cmd) + os.system(cmd) + except: + print("no access to hiveeyes.org?") + pass + time.sleep(1)