31 lines
869 B
Python
Executable File
31 lines
869 B
Python
Executable File
import time
|
|
|
|
from api import add
|
|
from db.base import Base, engine
|
|
from db.models.lot_data_model import LOT_DATA
|
|
|
|
Base.metadata.create_all(bind=engine)
|
|
try:
|
|
data = {'ambient_temperature': -1,
|
|
'ambient_humidity': -1,
|
|
'carbon_dioxide': -1,
|
|
'ambient_air_pressure': -1,
|
|
'ambient_lighting': -1,
|
|
'soil_moisture': -1,
|
|
'soil_temperature': -1,
|
|
'soil_conductivity': -1,
|
|
'soil_PH': -1,
|
|
'soil_potassium_phosphate_nitrogen': -1,
|
|
'soil_potassium_phosphate_phosphorus': -1,
|
|
'soil_potassium_phosphate_potassium': -1,
|
|
'rainfall': -1,
|
|
'wind_speed': -1,
|
|
'wind_direction': -1,
|
|
'create_time': int(time.time())
|
|
}
|
|
t2 = LOT_DATA(**data)
|
|
add(t2)
|
|
except Exception as e:
|
|
print(e)
|
|
pass
|