creotiv / MiBand2

Library to work with Xiaomi MiBand 2
Creative Commons Zero v1.0 Universal
544 stars 173 forks source link

--recorded breaks bc of TypeError #26

Open maste9 opened 5 years ago

maste9 commented 5 years ago

When I fire python3 example.py --recorded -mac xx:xx:xx:xx:xx:xx I receive the following exception:

File "example.py", line 34, in <module>
    band.start_get_previews_data(start_time)
  File "/home/homer77/Programming/MiBand2/base.py", line 516, in start_get_previews_data
    ts = year + month + day + hour + minute
TypeError: can't concat int to bytes

I already messed around a little with the struc.pack lines to translate everything into bytes type. But then the script breaks again because the byte type doesn't have recode method.

Is anyone able to reproduce this error?

chauvuluan commented 4 years ago

sudo python example.py --recorded --mac yourMac