Update Xiaomi_Scale.py

This commit is contained in:
5high 2021-01-09 23:25:04 +08:00 committed by GitHub
parent a8d1d1573c
commit 6b8ccc2412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,7 +292,7 @@ class ScanProcessor():
message += ',"身体类型":"' + str(bodyscale[lib.getBodyType()]) + '"' message += ',"身体类型":"' + str(bodyscale[lib.getBodyType()]) + '"'
message += ',"代谢年龄":' + "{:.0f}".format(lib.getMetabolicAge()) message += ',"代谢年龄":' + "{:.0f}".format(lib.getMetabolicAge())
message += ',"timestamp":"' + mitdatetime + '"' message += ',"测量时间":"' + mitdatetime + '"'
message += '}' message += '}'
try: try:
sys.stdout.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Publishing data to topic {MQTT_PREFIX + '/' + user + '/weight'}: {message}\n") sys.stdout.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Publishing data to topic {MQTT_PREFIX + '/' + user + '/weight'}: {message}\n")