Example update

This commit is contained in:
klaute 2020-03-27 19:06:11 +01:00
parent 504b27a834
commit d0b15a162a
2 changed files with 4 additions and 2 deletions

View file

@ -13,7 +13,7 @@ from influxdb import InfluxDBClient
from oko_user_config import *
oko_influxdb_query = "select last(temperature), humidity, light, windspeed, pressure from weather where device='"
oko_influxdb_query = "select temperature, humidity, light, windspeed, pressure from weather where device='%STATION%' order by time desc limit 1;"
def read_data_from_influxdb():
# temp, hum, wind, pres, date
@ -21,7 +21,7 @@ def read_data_from_influxdb():
client = InfluxDBClient(oko_server, oko_server_port, oko_user, oko_password, oko_dbname)
query = oko_influxdb_query + oko_weatherstation_name + "';"
query = oko_influxdb_query.replace("%STATION%", oko_weatherstation_name)
print(query)
qres = client.query(query)

View file

@ -1,3 +1,5 @@
# do not midify this file
# copy thos file to oko_user_config.py
oko_server = "influxdb host"
oko_server_port = "8082"