From 85f4107938a6400426cd85ea2cd48e06341997b3 Mon Sep 17 00:00:00 2001 From: Jonny Ervine Date: Mon, 17 Aug 2026 22:09:04 +0800 Subject: [PATCH] Default database table to TempHumid when missing from config. Preserves compatibility with existing /etc/thMonitor.conf files created before the table option was added. Co-authored-by: Cursor --- python_code/thmonitor_common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_code/thmonitor_common.py b/python_code/thmonitor_common.py index 1229e36..6ba8712 100644 --- a/python_code/thmonitor_common.py +++ b/python_code/thmonitor_common.py @@ -51,7 +51,9 @@ def load_config(path=DEFAULT_CONFIG): 'loglevel': config.get('software', 'loglevel'), 'host': config.get('database', 'host'), 'db': config.get('database', 'db'), - 'table': validate_table_name(config.get('database', 'table')), + 'table': validate_table_name( + config.get('database', 'table', fallback='TempHumid'), + ), 'username': config.get('database', 'username'), 'password': config.get('database', 'password'), 'sql_retries': config.getint('database', 'sql_retries'),