From c43bf42666df238ba837d946092c2009b3bf2848 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Thu, 6 Jun 2024 13:07:44 +0200 Subject: [PATCH] Fix sqlite3 multithreading. --- thermostat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/thermostat.py b/thermostat.py index 7e5982a..58f5518 100644 --- a/thermostat.py +++ b/thermostat.py @@ -272,7 +272,9 @@ def thermostat_loop(): global forced_mode global new_forced_mode global current_time - global cursor + + dbconn = sqlite3.connect("./instance/thermostat.db") + cursor = dbconn.cursor() while True: # if stop.is_set():