Fix missed field to tag

This commit is contained in:
ahosking 2022-07-03 01:20:43 -04:00
parent b073c37db0
commit 6bb2be70f7

View File

@ -89,7 +89,7 @@ def add_time():
print() print()
write_api = client.write_api(write_options=SYNCHRONOUS) write_api = client.write_api(write_options=SYNCHRONOUS)
p = influxdb_client.Point("2016_odyssey").time(timestamp).tag("oilhealth", oilhealth)\ p = influxdb_client.Point("2016_odyssey").time(timestamp).tag("oilhealth", oilhealth)\
.tag("fuel", fuel).field("fuelcost", fuelcost).tag("winter", winter).field("odometer", float(odometer)) .tag("fuel", fuel).tag("fuelcost", fuelcost).tag("winter", winter).field("odometer", float(odometer))
write_api.write(bucket="gas", org=config['DB_ORG'], record=p) write_api.write(bucket="gas", org=config['DB_ORG'], record=p)
print ("Submitting data to DB: {0}".format(json_body)) print ("Submitting data to DB: {0}".format(json_body))
#client.write_points(json_body) #client.write_points(json_body)