Update main.py

This commit is contained in:
1708639776959.sdtroot 2025-02-18 23:13:17 +00:00
parent 9ce89eded7
commit 7d054dd291
1 changed files with 3 additions and 3 deletions

View File

@ -25,9 +25,9 @@ def main():
while True: while True:
data = extract_data(items[index]) data = extract_data(items[index])
if data: if data:
msg = json.dumps(data, ensure_ascii=False, default=str) # msg = json.dumps(data, ensure_ascii=False, default=str)
sdtcloudMqttClient.pubMessage(msg) sdtcloudMqttClient.pubMessage(data)
print(f"{time.strftime('%Y-%m-%d %H:%M:%S')} Extracted data:{msg}") print(f"{time.strftime('%Y-%m-%d %H:%M:%S')} Extracted data:{data}")
else: else:
print("No 'data' key found in the JSON item.") print("No 'data' key found in the JSON item.")