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
+2 -2
View File
@@ -9,11 +9,11 @@ import MySQLdb
NO_PREVIOUS = ('NULL', 'NULL')
def main(host, db, user, passwd, logging, sql_retries, sql_timeout):
def main(host, db, table, user, passwd, logging, sql_retries, sql_timeout):
logging.debug('Reading MySQL database next ...')
sql = (
'SELECT Temperature, Humidity FROM TempHumid '
f'SELECT Temperature, Humidity FROM `{table}` '
'ORDER BY ComputerTime DESC LIMIT 1'
)