repository to manage all files related to the makeathon farm bot project (Software + Documentation).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

createdatabase_and_test.py 807B

1234567891011121314151617181920212223
  1. import random
  2. from plantdatabase import PlantDataBase
  3. mydatabase = PlantDataBase()
  4. mydatabase.create_table()
  5. for i in range(1,6):
  6. mydatabase.insert_plant(_gps='gps', plantname=f"Pflanze{i}")
  7. for i in range(1,7):
  8. plant_id = i
  9. temp = random.random()
  10. humidity = random.random()
  11. soil_moisture = random.random()
  12. pest_infestation = 0
  13. light_intensity = random.random()
  14. mydatabase.insert_measurement_data(plant_id=plant_id,
  15. sensordata_temp=temp,
  16. sensordata_humidity=humidity,
  17. sensordata_soil_moisture=soil_moisture,
  18. pest_infestation=pest_infestation,
  19. light_intensity=light_intensity)