chore: sync local changes

This commit is contained in:
2026-02-19 22:22:27 +01:00
parent 7013b69e03
commit 77c8039af6
4 changed files with 6 additions and 21 deletions

5
app.py
View File

@@ -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}"