From 39c73fa3f2252fcea108143802b0c0ddad120e97 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Thu, 7 Sep 2023 21:42:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Healthbeat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Healthbeat.py b/Healthbeat.py index efe3739..8deee36 100644 --- a/Healthbeat.py +++ b/Healthbeat.py @@ -5,6 +5,7 @@ import logging import pymysql import threading import json +import datetime from dotenv import load_dotenv class Camera: @@ -31,7 +32,7 @@ class Camera: with conn: with conn.cursor() as cursor: - cursor.execute("update devices set state = %s where id = %s", (status, self.id)) + cursor.execute("update devices set state = %s, updated_at = %s where id = %s", (status, datetime.datetime.now(), self.id)) conn.commit() def init_logger():