From 751b2934b8851f4ecf4d258ce5a103cf723ee91e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 13 Jun 2024 09:45:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E9=A2=91=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mqttc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mqttc.py b/mqttc.py index 44e025c..fb906d5 100644 --- a/mqttc.py +++ b/mqttc.py @@ -54,7 +54,7 @@ def save_items(payload): data['timex'] = datetime.strptime(item['time'], "%Y%m%d%H%M%S").replace(tzinfo=tz.gettz('Asia/Shanghai')) data['mpoint_id'] = item['name'] last_timex: datetime = mpoint_dict.get(data['mpoint_id'], None) - if data["timex"].second not in getattr(conf.SAVE_SECONDS, [2, 7, 12, 17, 22, 27, 32, 37, 42, 47, 52, 57]) or ( + if data["timex"].second not in getattr(conf, "SAVE_SECONDS", [2, 7, 12, 17, 22, 27, 32, 37, 42, 47, 52, 57]) or ( last_timex and last_timex.second == data["timex"].second): continue try: