Update main.py
This commit is contained in:
parent
9ce89eded7
commit
7d054dd291
6
main.py
6
main.py
|
@ -25,9 +25,9 @@ def main():
|
|||
while True:
|
||||
data = extract_data(items[index])
|
||||
if data:
|
||||
msg = json.dumps(data, ensure_ascii=False, default=str)
|
||||
sdtcloudMqttClient.pubMessage(msg)
|
||||
print(f"{time.strftime('%Y-%m-%d %H:%M:%S')} Extracted data:{msg}")
|
||||
# msg = json.dumps(data, ensure_ascii=False, default=str)
|
||||
sdtcloudMqttClient.pubMessage(data)
|
||||
print(f"{time.strftime('%Y-%m-%d %H:%M:%S')} Extracted data:{data}")
|
||||
else:
|
||||
print("No 'data' key found in the JSON item.")
|
||||
|
||||
|
|
Loading…
Reference in New Issue