+hiveeeyes
This commit is contained in:
parent
2b5251a28d
commit
ca3641641f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue