如何从Jawbone UP API获取深度睡眠和REM睡眠数据? [英] How can I get deep and REM sleep data from the Jawbone UP API?

查看:212
本文介绍了如何从Jawbone UP API获取深度睡眠和REM睡眠数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击 sleeps端点时,我看不到任何返回值深度睡眠.

When I hit the sleeps endpoint, I don't see any value returned for deep sleep.

我发送了此请求: https://jawbone.com/nudge/api/v.1.1/users/@me/sleeps?date=20160525

这是我收到的回复:

{u'data': {u'items': [{u'date': 20160525,
                   u'details': {u'asleep_time': 1464152838,
                                u'awake': 2284,
                                u'awake_time': 1464183066,
                                u'awakenings': 1,
                                u'body': u'',
                                u'duration': 30828,
                                u'light': 14661,
                                u'mind': 0,
                                u'quality': u'',
                                u'rem': 11265,
                                u'smart_alarm_fire': u'',
                                u'sound': 2618,
                                u'sunrise': None,
                                u'sunset': None,
                                u'tz': u'America/Los_Angeles'},
                   u'shared': True,
                   u'sub_type': 0,
                   u'time_completed': 1464183066,
                   u'time_created': 1464152238,
                   u'time_updated': 1464189792,
                   u'title': u'for 7h 55m',
                   u'xid': u'<XID>'}],
       u'size': 1},
u'meta': {u'code': 200,
       u'message': u'OK',
       u'time': 1464219784,
       u'user_xid': u'<XID>'}}

深度睡眠的价值在哪里?

Where is the value for deep sleep?

此外,当我请求此睡眠的滴答声时: https://jawbone.com/nudge/api/v. 1.1/sleeps//ticks

Additionally, when I make a request for the ticks for this sleep: https://jawbone.com/nudge/api/v.1.1/sleeps//ticks

我收到以下答复:

{u'data': {u'items': [{u'depth': 1, u'time': 1464152238},
                      {u'depth': 2, u'time': 1464152838},
                      {u'depth': 3, u'time': 1464155641},
                      {u'depth': 3, u'time': 1464156465},
                      {u'depth': 3, u'time': 1464157134},
                      {u'depth': 3, u'time': 1464158170},
                      {u'depth': 3, u'time': 1464159358},
                      {u'depth': 3, u'time': 1464160060},
                      {u'depth': 2, u'time': 1464160821},
                      {u'depth': 3, u'time': 1464161157},
                      {u'depth': 1, u'time': 1464161492},
                      {u'depth': 2, u'time': 1464162532},
                      {u'depth': 3, u'time': 1464162930},
                      {u'depth': 2, u'time': 1464163656},
                      {u'depth': 3, u'time': 1464164715},
                      {u'depth': 2, u'time': 1464165502},
                      {u'depth': 3, u'time': 1464168230},
                      {u'depth': 2, u'time': 1464169924},
                      {u'depth': 3, u'time': 1464170771},
                      {u'depth': 2, u'time': 1464171134},
                      {u'depth': 3, u'time': 1464171739},
                      {u'depth': 2, u'time': 1464172253},
                      {u'depth': 3, u'time': 1464174025},
                      {u'depth': 2, u'time': 1464175249},
                      {u'depth': 3, u'time': 1464176444},
                      {u'depth': 2, u'time': 1464178035},
                      {u'depth': 3, u'time': 1464179690},
                      {u'depth': 1, u'time': 1464181159},
                      {u'depth': 2, u'time': 1464181803}],
           u'size': 29},
 u'meta': {u'code': 200,
           u'message': u'OK',
           u'time': 1464220564,
           u'user_xid': u'105utfm8iq4'}}

根据文档,1 =清醒,2 =轻,3 =深,那么REM在哪里?

According to the documentation, 1=awake, 2=light, 3=deep, so where is REM?

推荐答案

这里有两个问题.

首先,sleeping端点文档已过期.在睡眠端点的响应中,将声音"值用于总深度睡眠.在上面的响应中,这将是:

The first is that the sleeps endpoint documentation is out of date. In the response from the sleeps endpoint, use the 'sound' value for the total deep sleep. In the response above, this would be:

u'sound': 2618,

第二个问题是,睡眠滴答目前无法区分深度/健全睡眠和快速眼动.

The second issue is that the sleep ticks do not currently distinguish between deep/sound sleep and REM.

我们将在内部审查这些问题,并更新API的文档和行为.

We will review these issues internally and update the documentation and the behavior of the API.

这篇关于如何从Jawbone UP API获取深度睡眠和REM睡眠数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆