from datetime import datetime

from .influxdb import InfluxDB
from structures.plant import PlantState

localtz = datetime.now().astimezone().tzinfo

db = InfluxDB("http://localhost:8086")

timestamp = datetime.now(localtz)

x = [
  PlantState(timestamp, 'TEST', False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)
]

db.write(x)