Skip to content

Commit

Permalink
Validate that the data are well collected before creating the fit file
Browse files Browse the repository at this point in the history
  • Loading branch information
svanhoutte committed Dec 27, 2021
1 parent 8f36524 commit d87c8f6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions connect_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ cat ./test | awk -F\<wyze_sdk.ScaleRecord '{print $2}' | awk -F'[ |/}]' '{print
cp ./wyze.csv ./wyze.1.csv
awk -F, '{$8=substr($8, 1, 10); ts= $8-631065600; printf "Data,0,weight_scale,timestamp,";printf "%.0f",ts; print",s,weight,"($11*0.45359237)",kg,percent_fat,"$3",\045,percent_hydration,"$6",\045,muscle_mass,"$10",kg,physique_rating,"$4",,basal_met,"$2",kcal/day,visceral_fat_rating,"$5",,bone_mass,"$7",kg,metabolic_age,"$9",years"}' ./test5 >> ./wyze.1.csv
md5sum ./wyze.1.csv | awk '{print $1,"./wyze.last.csv"}' > ./cksum.txt
#echo `cat ./wyze.1.csv`
Datavalid=$(awk -F',' 'END {print $NF}' ./wyze.1.csv)
if [ "$Datavalid" = "years" ]; then
echo "File is correct."
else
echo "File is not correct."
exit 0
fi
if md5sum -c ./cksum.txt; then
echo "no new measurment"
exit 0
Expand Down

0 comments on commit d87c8f6

Please sign in to comment.