LoginSignup
2
1

More than 5 years have passed since last update.

pythonのfitbitでsleepのstageを取得する

Posted at

pip3 install fitbit

でいれたモジュールはAPIのバージョンが1だから、取れないっぽい。

https://github.com/orcasgit/python-fitbit/issues/128
とかをみると、1.2にすればいけるっぽい。

pipでいれたモジュールの調整がよくわからなかったので、直接書き換え。

homebrewでpython3を入れたosx(macos) Mojaveでの話

/usr/local/lib/python3.7/site-packages/fitbit/api.py

API_VERSION = 1

API_VERSION = 1.2

に書き換える。
2箇所あるよ。

これでfitbit.sleep(date=dtToday)すれば、minutesDataではなく、levelsが取れる。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1