From 544480687a174ed734cb1893095022f3f4093911 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 7 Jan 2021 17:21:36 +0800 Subject: [PATCH] change message to Chinese --- .DS_Store | Bin 0 -> 6148 bytes mi-scale/.DS_Store | Bin 0 -> 6148 bytes mi-scale/src/Xiaomi_Scale.py | 26 +++++++++++++------------- 3 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 .DS_Store create mode 100644 mi-scale/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1680434e3bbe4e4925a052534c096d7fa8f1337a GIT binary patch literal 6148 zcmeHKPm9w)6o0eLx@knWg0OlEh~S}0>lS5MgxGBl1yLcQ2bJBVEo~&pge0}>)=Ch+ zfLFbE^&5Eh=+%Pv9=I}>NyHA6tWT^%e1B!uvkpcGYYH$rk;6YmWek~s;Q{*(zq5CzNhIh0 z>_)zqq>aW`vQ*KQPp#;>p&Mt6r}mgm?bJypN!y7Zv)+9t9lNsqfKq?acHD>FaJpSP zzeU5;@xo!uoxQ;jO`bgR!U3JO=_DK^d>&gUbiJxqw`&(?vsUAJ-CV!fnAgo&v(?(D zo2~U5^LbTYyWG6h+X;5}W-sP1-}1c!!SkNWs>FSGhm8_5h0Kz(dxzQNbKCj2$Zct^ ze0GnsE995FXYrNhdTz&|Ps0)F*nUdgja!m;YiV=rt~IgjU}3`SGJ)I$D|sFB2D^$cVBvx~lQj@6 ViJ3qgK~aAMI1Q>&4E$9Fege%G*7pDa literal 0 HcmV?d00001 diff --git a/mi-scale/.DS_Store b/mi-scale/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d443f87771c4295611c872910e58d478e38b59fe GIT binary patch literal 6148 zcmeHK%T60H6g^I|NP$Xp)hh^B`~{nS z1U~>3pTZt`u6=>bObD>4s^TkMA3yG~$H%fg24Gh9yNkd)fF@nAF~eknNxOK(YFhJ( zXlx&ASj9(dVhycIw6E|Acm@771!V8e;XOW}jZfUScl)=8?s}TVTWPk%7&#!8=JH{E2J>-}J>|s=5 z9zC9!CX1ao>kY^dTc=MMrw}MXE0dGE uHlTl@i%DGW&{CM_b!;;uZL-3j6^KGr_$8 literal 0 HcmV?d00001 diff --git a/mi-scale/src/Xiaomi_Scale.py b/mi-scale/src/Xiaomi_Scale.py index 58cf233..45d268e 100644 --- a/mi-scale/src/Xiaomi_Scale.py +++ b/mi-scale/src/Xiaomi_Scale.py @@ -274,23 +274,23 @@ class ScanProcessor(): lib = Xiaomi_Scale_Body_Metrics.bodyMetrics(calcweight, height, age, sex, 0) message = '{' - message += '"weight":' + "{:.2f}".format(weight) - message += ',"weight_unit":"' + str(unit) + '"' - message += ',"bmi":' + "{:.2f}".format(lib.getBMI()) - message += ',"basal_metabolism":' + "{:.2f}".format(lib.getBMR()) - message += ',"visceral_fat":' + "{:.2f}".format(lib.getVisceralFat()) + message += '"重量":' + "{:.2f}".format(weight) + message += ',"重量单位":"' + str(unit) + '"' + message += ',"BMI身体质量指数":' + "{:.2f}".format(lib.getBMI()) + message += ',"基本代谢":' + "{:.2f}".format(lib.getBMR()) + message += ',"内脏脂肪":' + "{:.2f}".format(lib.getVisceralFat()) if hasImpedance: lib = Xiaomi_Scale_Body_Metrics.bodyMetrics(calcweight, height, age, sex, int(miimpedance)) bodyscale = ['Obese', 'Overweight', 'Thick-set', 'Lack-exerscise', 'Balanced', 'Balanced-muscular', 'Skinny', 'Balanced-skinny', 'Skinny-muscular'] - message += ',"lean_body_mass":' + "{:.2f}".format(lib.getLBMCoefficient()) - message += ',"body_fat":' + "{:.2f}".format(lib.getFatPercentage()) - message += ',"water":' + "{:.2f}".format(lib.getWaterPercentage()) - message += ',"bone_mass":' + "{:.2f}".format(lib.getBoneMass()) - message += ',"muscle_mass":' + "{:.2f}".format(lib.getMuscleMass()) - message += ',"protein":' + "{:.2f}".format(lib.getProteinPercentage()) - message += ',"body_type":"' + str(bodyscale[lib.getBodyType()]) + '"' - message += ',"metabolic_age":' + "{:.0f}".format(lib.getMetabolicAge()) + message += ',"去脂体重":' + "{:.2f}".format(lib.getLBMCoefficient()) + message += ',"体脂":' + "{:.2f}".format(lib.getFatPercentage()) + message += ',"水分":' + "{:.2f}".format(lib.getWaterPercentage()) + message += ',"骨量":' + "{:.2f}".format(lib.getBoneMass()) + message += ',"肌肉量":' + "{:.2f}".format(lib.getMuscleMass()) + message += ',"蛋白质":' + "{:.2f}".format(lib.getProteinPercentage()) + message += ',"身体类型":"' + str(bodyscale[lib.getBodyType()]) + '"' + message += ',"代谢年龄":' + "{:.0f}".format(lib.getMetabolicAge()) message += ',"timestamp":"' + mitdatetime + '"' message += '}'