Make the MySQL table name configurable instead of hardcoding TempHumid.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-16 11:44:18 +08:00
co-authored by Cursor
parent 8010cd9045
commit 2d1e319160
7 changed files with 31 additions and 10 deletions
+4 -2
View File
@@ -13,7 +13,8 @@ import thmonitor_common as common
def sensor_read(cfg, dev_type, dhtpin):
"""Perform a single sensor read using the last DB values for validation."""
oldtemp, oldhumid = readMysql.main(
cfg['host'], cfg['db'], cfg['username'], cfg['password'],
cfg['host'], cfg['db'], cfg['table'],
cfg['username'], cfg['password'],
logging, cfg['sql_retries'], cfg['sql_timeout'],
)
logging.debug(
@@ -57,7 +58,8 @@ def sensor_read(cfg, dev_type, dhtpin):
if common.reading_is_plausible(t, h, oldtemp, oldhumid, limits):
updateMysql.main(
t, h,
cfg['host'], cfg['db'], cfg['username'], cfg['password'],
cfg['host'], cfg['db'], cfg['table'],
cfg['username'], cfg['password'],
logging, cfg['sql_retries'], cfg['sql_timeout'],
)
return 0