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 <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 22:09:04 +08:00
co-authored by Cursor
parent 2d1e319160
commit 85f4107938
+3 -1
View File
@@ -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'),