Battery - TakayukiHoshi1984/DeviceConnect-Spec GitHub Wiki
ã¹ããŒãããã€ã¹ã®ããããªãŒæ å ±ãæäŸããAPIã
API | æŠèŠ |
---|---|
GET /gotapi/battery | ã¹ããŒãããã€ã¹ã®ããããªãŒæ å ±ãååŸããã |
GET /gotapi/battery/charging | ã¹ããŒãããã€ã¹ã®å é»ç¶æ ãã©ã°ãååŸããã |
GET /gotapi/battery/chargingTime | ã¹ããŒãããã€ã¹ã®å é»å®äºæéãååŸããã |
GET /gotapi/battery/dischargingTime | ã¹ããŒãããã€ã¹ã®æŸé»å®äºæéãååŸããã |
GET /gotapi/battery/level | ã¹ããŒãããã€ã¹ã®ããããªãŒæ®éãååŸããã |
GET /gotapi/battery/onBatteryChange | ã¹ããŒãããã€ã¹ã®ããããªãŒç¶æ å€åéç¥ã€ãã³ããååŸããã |
PUT /gotapi/battery/onBatteryChange | ã¹ããŒãããã€ã¹ã®ããããªãŒã®ç¶æ ãå€åããããšãéç¥ããã |
DELETE /gotapi/battery/onBatteryChange | åœè©²ã€ãã³ãã®éç¥ãåæ¢ããã |
GET /gotapi/battery/onChargingChange | ã¹ããŒãããã€ã¹ã®ããããªãŒå é»ç¶æ å€åéç¥ã€ãã³ããååŸããã |
PUT /gotapi/battery/onChargingChange | ã¹ããŒããã©ã³ãããã¯åšèŸºæ©åšãžä»æ¹ã®ã¹ããŒãããã€ã¹ã® ããããªãŒã®å é»ç¶æ ãå€åããããšãéç¥ããã |
DELETE /gotapi/battery/onChargingChange | åœè©²ã€ãã³ãã®éç¥ãåæ¢ããã |
one-shot
ã¹ããŒãããã€ã¹ã®ããããªãŒæ å ±ãååŸããã
ã¹ããŒãããã€ã¹ã®ããããªãŒæ å ±ãšããŠååŸã§ããªãå€ãããå Žå㯠é©åãªå€ãä»£å ¥ããŠã¬ã¹ãã³ã¹ãè¿åŽããã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
å é»ç¶æ ãã©ã° | charging | boolean | Yes | å
é»äž:true éå é»äž:false |
å®å šå é»ãŸã§ã®æé (ç§) | chargingTime | long | No | æºå
é»ããŸãã¯éå
é»äžã®å Žåã¯0ã ã·ã¹ãã ãšããŠååŸåºæ¥ãªãå Žåã¯Number.MAX_VALUEã |
å®å šæŸé»ãŸã§ã®æé (ç§) | dischargingTime | long | No | å é»äžããŸãã¯ã·ã¹ãã ãšããŠååŸåºæ¥ãªãå Žåã¯Number.MAX_VALUE |
ããããªãŒæ®é | level | float | No | ç¯å²: 0.0 <= level <= 1.0 |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "charging" : true, "chargingTime" : 10, "dischargingTime" : 0, "level" : 0.8 }
one-shot
ã¹ããŒãããã€ã¹ã®å é»ç¶æ ãã©ã°ãååŸããã
å
é»äž:true
éå
é»äž:false
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
å é»ç¶æ ãã©ã° | charging | boolean | Yes | å
é»äž:true éå é»äž:false |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "charging" : true }
one-shot
ã¹ããŒãããã€ã¹ã®å é»å®äºæéãååŸããã
ã¹ããŒãããã€ã¹ã®å é»ãå®äºããæéãè¿ãã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
å®å šå é»ãŸã§ã®æé (ç§) | chargingTime | long | Yes | æºå
é»ããŸãã¯éå
é»äžã®å Žåã¯0ã ã·ã¹ãã ãšããŠååŸåºæ¥ãªãå Žåã¯Number.MAX_VALUEã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "chargingTime" : 10 }
one-shot
ã¹ããŒãããã€ã¹ã®æŸé»å®äºæéãååŸããã
ã¹ããŒãããã€ã¹ã®ããããªãŒæ®éããªããªããŸã§ã®æéãè¿ãã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
å®å šæŸé»ãŸã§ã®æé (ç§) | dischargingTime | long | Yes | å é»äžããŸãã¯ã·ã¹ãã ãšããŠååŸåºæ¥ãªãå Žåã¯Number.MAX_VALUEã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "dischargingTime" : 0 }
one-shot
ã¹ããŒãããã€ã¹ã®ããããªãŒæ®éãååŸããã
ã¹ããŒãããã€ã¹ã®ããããªãŒæ®éã¯0.0ã1.0ã®ç¯å²ã§è¿ãã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
ããããªãŒæ®é | level | float | Yes | ç¯å²: 0.0 <= level <= 1.0 |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "level" : 0.8 }
one-shot
ã¹ããŒãããã€ã¹ã®ããããªãŒç¶æ å€åéç¥ã€ãã³ããååŸããã
ãã©ã°ã€ã³åŽã§ãã£ãã·ã¥ããŠããææ°ã®ã€ãã³ãã¡ãã»ãŒãžã1ã€ååŸããã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ | |
---|---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
|
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã | |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã | |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã | |
ããããªãŒæ å ± | battery | object | Yes | ||
å®å šå é»ãŸã§ã®æé (ç§) | chargingTime | long | Yes | æºå
é»ããŸãã¯éå
é»äžã®å Žåã¯0ã ã·ã¹ãã ãšããŠååŸåºæ¥ãªãå Žåã¯Number.MAX_VALUEã |
|
å®å šæŸé»ãŸã§ã®æé (ç§) | dischargingTime | long | Yes | å é»äžããŸãã¯ã·ã¹ãã ãšããŠååŸåºæ¥ãªãå Žåã¯Number.MAX_VALUEã | |
ããããªãŒæ®é | level | float | Yes | ç¯å²: 0.0 <= level <= 1.0 |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "battery" : { "chargingTime" : 10, "dischargingTime" : 0, "level" : 0.8 } }
event
ã¹ããŒãããã€ã¹ã®ããããªãŒã®ç¶æ ãå€åããããšãéç¥ããã
å é»æéãæŸé»æéãããããªãŒæ®éã®å€ãå€ãã£ãæã«ã€ãã³ããçºè¡ãããã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
interval | long | No | ã€ãã³ãåä¿¡ééãåäœïŒmSec |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ | |
---|---|---|---|---|---|
ãµãŒãã¹ID | serviceId | string | Yes | ã€ãã³ããéä¿¡ãããµãŒãã¹ã®ID | |
ãããã¡ã€ã«å | profile | string | Yes | ãããã¡ã€ã«åã | |
ã€ã³ã¿ãŒãã§ãŒã¹å | interface | string | Yes | ã€ã³ã¿ãŒãã§ãŒã¹åã | |
ã¢ããªãã¥ãŒãå | attribute | string | Yes | ã¢ããªãã¥ãŒãåã | |
ããããªãŒæ å ± | battery | object | Yes | ||
å®å šå é»ãŸã§ã®æé (ç§) | chargingTime | long | Yes | æºå
é»ããŸãã¯éå
é»äžã®å Žåã¯0ã ã·ã¹ãã ãšããŠååŸåºæ¥ãªãå Žåã¯Number.MAX_VALUEã |
|
å®å šæŸé»ãŸã§ã®æé (ç§) | dischargingTime | long | Yes | å é»äžããŸãã¯ã·ã¹ãã ãšããŠååŸåºæ¥ãªãå Žåã¯Number.MAX_VALUEã | |
ããããªãŒæ®é | level | float | Yes | ç¯å²: 0.0 <= level <= 1.0 |
{ "serviceId" : "example-service-id", "profile" : "battery", "attribute" : "onBatteryChange", "battery" : { "chargingTime" : 10, "dischargingTime" : 0, "level" : 0.8 } }
event
åœè©²ã€ãã³ãã®éç¥ãåæ¢ããã
ã€ãã³ãéç¥ã®åæ¢ã«å€±æããå Žåã¯ãšã©ãŒãè¿ãã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }
one-shot
ã¹ããŒãããã€ã¹ã®ããããªãŒå é»ç¶æ å€åéç¥ã€ãã³ããååŸããã
ãã©ã°ã€ã³åŽã§ãã£ãã·ã¥ããŠããææ°ã®ã€ãã³ãã¡ãã»ãŒãžã1ã€ååŸããã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ | |
---|---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
|
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã | |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã | |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã | |
ããããªãŒæ å ± | battery | object | Yes | ||
å é»ç¶æ ãã©ã° | charging | boolean | Yes | å
é»äž:true éå é»äž:false |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0", "battery" : { "charging" : true } }
event
ã¹ããŒããã©ã³ãããã¯åšèŸºæ©åšãžä»æ¹ã®ã¹ããŒãããã€ã¹ã® ããããªãŒã®å é»ç¶æ ãå€åããããšãéç¥ããã
å é»äžãã©ã°ã®å€ãtrueããfalseã ãããã¯ãfalseããtrueãžå€ãã£ãæã«ã€ãã³ããçºè¡ãããã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
interval | long | No | ã€ãã³ãåä¿¡ééãåäœïŒmSec |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ | |
---|---|---|---|---|---|
ãµãŒãã¹ID | serviceId | string | Yes | ã€ãã³ããéä¿¡ãããµãŒãã¹ã®ID | |
ãããã¡ã€ã«å | profile | string | Yes | ãããã¡ã€ã«åã | |
ã€ã³ã¿ãŒãã§ãŒã¹å | interface | string | Yes | ã€ã³ã¿ãŒãã§ãŒã¹åã | |
ã¢ããªãã¥ãŒãå | attribute | string | Yes | ã¢ããªãã¥ãŒãåã | |
ããããªãŒæ å ± | battery | object | Yes | ||
å é»ç¶æ ãã©ã° | charging | boolean | Yes | å
é»äž:true éå é»äž:false |
{ "serviceId" : "example-service-id", "profile" : "battery", "attribute" : "onChargingChange", "battery" : { "charging" : true } }
event
åœè©²ã€ãã³ãã®éç¥ãåæ¢ããã
ã€ãã³ãéç¥ã®åæ¢ã«å€±æããå Žåã¯ãšã©ãŒãè¿ãã
ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|
serviceId | string | Yes | ãµãŒãã¹IDãååŸå¯Ÿè±¡ã¹ããŒãããã€ã¹ |
è«çå | ç©çå | ããŒã¿å | å¿ é | 説æ |
---|---|---|---|---|
åŠççµæ | result | integer | Yes | 0: æ£åžžå¿ç 0以å€: ç°åžžå¿ç |
ã·ã¹ãã å | product | string | Yes | DeviceConnectã·ã¹ãã ã®ååã |
ã·ã¹ãã ããŒãžã§ã³ | version | string | Yes | DeviceConnectã·ã¹ãã ã®ããŒãžã§ã³åã |
眲å | hmac | string | No | ã¬ã¹ãã³ã¹ã«å¯Ÿãã眲åã ã¢ããªã±ãŒã·ã§ã³åŽããäºåã«HMACããŒãå ±æãããŠããå Žåã¯å¿ é ã |
{ "result" : 0, "product" : "Example System", "version" : "1.0.0" }