1234567891011121314151617181920212223 |
- import random
-
- from plantdatabase import PlantDataBase
-
- mydatabase = PlantDataBase()
- mydatabase.create_table()
-
- for i in range(1,6):
- mydatabase.insert_plant(_gps='gps', plantname=f"Pflanze{i}")
-
- for i in range(1,7):
- plant_id = i
- temp = random.random()
- humidity = random.random()
- soil_moisture = random.random()
- pest_infestation = 0
- light_intensity = random.random()
- mydatabase.insert_measurement_data(plant_id=plant_id,
- sensordata_temp=temp,
- sensordata_humidity=humidity,
- sensordata_soil_moisture=soil_moisture,
- pest_infestation=pest_infestation,
- light_intensity=light_intensity)
|