First working version with smllib
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from influxdb_client import InfluxDBClient, Point, WritePrecision
|
||||
from influxdb_client.client.write_api import SYNCHRONOUS
|
||||
|
||||
token = "chOaOOaMs1QpQaYwYgj3TWT-z1LxuoWP_YC7M0rrFqFwNDVnGzyGKrUMqSPHN0_xPOgyEzedKu3i8wbCLVHyFg=="
|
||||
org = "main"
|
||||
bucket = "power"
|
||||
|
||||
client = InfluxDBClient(url="http://localhost:8086", token=token, org=org, timeout=30000)
|
||||
write_api = client.write_api(write_options=SYNCHRONOUS)
|
||||
|
||||
|
||||
def writeToDB(dataPoints):
|
||||
""" Writes measurement to influx
|
||||
"""
|
||||
write_api.write(bucket, record=dataPoints)
|
||||
print("Added to DB")
|
||||
Reference in New Issue
Block a user