chore: sync local changes
This commit is contained in:
5
app.py
5
app.py
@@ -10,7 +10,7 @@ def database_connect():
|
||||
connection = mysql.connector.connect(
|
||||
host="localhost",
|
||||
user="root",
|
||||
password="",
|
||||
password="root",
|
||||
database="goodgarden"
|
||||
)
|
||||
return connection
|
||||
@@ -18,10 +18,12 @@ def database_connect():
|
||||
except Exception as e:
|
||||
|
||||
print("Database connection failed:", e)
|
||||
#Throw error
|
||||
return None
|
||||
|
||||
# Function to get data from the MySQL database
|
||||
def get_database_data():
|
||||
#Throw error
|
||||
mydb = database_connect()
|
||||
if mydb and mydb.is_connected():
|
||||
|
||||
@@ -45,6 +47,7 @@ def get_data():
|
||||
return jsonify(battery_data) # Directly return the list of dictionaries as JSON
|
||||
|
||||
def get_weather_data():
|
||||
# Api key in a file
|
||||
api_key = "05ddd06644"
|
||||
location = "Leiden"
|
||||
url = f"https://weerlive.nl/api/weerlive_api_v2.php?key={api_key}&locatie={location}"
|
||||
|
||||
Reference in New Issue
Block a user