查看Cloud Of Things API的源代码
←
Cloud Of Things API
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== Sensors == === Create === <br> {| border="0" width=600 cellspacing="1" cellpadding="8" align="left" bgcolor=#1b74c2 | style="background:#dee7ec" width=80| URL | style="background:#ffffff" | http://api.easyhomelink.org/v1/device/DEV_ID/sensors |- | style="background:#dee7ec" | Formats | style="background:#ffffff" | JSON |- | style="background:#dee7ec" | Methods | style="background:#ffffff" | POST |- | style="background:#dee7ec" | Returns | style="background:#ffffff" | Sensor ID |} 例子: <pre> curl --request POST --data-binary @data.txt --header "UID: YOUR_UUID" http://api.easyhomelink.org/v1/device/5/sensors </pre> POST 的数据存放于文件 data.txt 中: <pre> { "name":"datastream", "tags":["tag1","tag2"], "unit": { "name": "humidity", "symbol": "%" } } </pre> 这是一个常见的通用型数据流型传感器,比如 温度传感器、湿度传感器、PM2.5 传感器、煤气浓度传感器、门磁传感器 ... 现在硬件集成度很高,一个芯片带多个传感器的模块很多,比如现在温度和湿度常常在一个模块上,我们建议对这样一个模块 Create 两个 Sensor,因为其随时间有两个数据流 返回值: <pre> { "id": 1 } </pre> <br><br> === View === <br> {| border="0" width=600 cellspacing="1" cellpadding="8" align="left" bgcolor=#1b74c2 | style="background:#dee7ec" width=80| URL | style="background:#ffffff" | http://api.easyhomelink.org/v1/device/DEV_ID/sensor/SEN_ID |- | style="background:#dee7ec" | Formats | style="background:#ffffff" | JSON |- | style="background:#dee7ec" | Methods | style="background:#ffffff" | GET |- | style="background:#dee7ec" | Returns | style="background:#ffffff" | 设备信息 |} 例子: <pre> curl --request GET --header "UID: YOUR_UUID" http://api.easyhomelink.org/v1/device/5/sensor/1 </pre> 返回值: <pre> { "name":"datastream", "tags":["tag1","tag2"], "unit": { "name": "humidity", "symbol": "%" } } </pre> <br><br> === Update === <br> {| border="0" width=600 cellspacing="1" cellpadding="8" align="left" bgcolor=#1b74c2 | style="background:#dee7ec" width=80| URL | style="background:#ffffff" | http://api.easyhomelink.org/v1/device/DEV_ID/sensor/SEN_ID |- | style="background:#dee7ec" | Formats | style="background:#ffffff" | JSON |- | style="background:#dee7ec" | Methods | style="background:#ffffff" | PUT |- | style="background:#dee7ec" | Returns | style="background:#ffffff" | 无 |} 例子: <pre> curl --request PUT --data-binary @data.txt --header "UID: YOUR_UUID" http://api.easyhomelink.org/v1/device/5/sensor/1 </pre> 上传的数据位于文件 data.txt: <pre> { "name":"datastream", "tags":["living room"], "unit": { "name": "humidity", "symbol": "%" } } </pre> <br><br> === Delete === <br> {| border="0" width=600 cellspacing="1" cellpadding="8" align="left" bgcolor=#1b74c2 | style="background:#dee7ec" width=80| URL | style="background:#ffffff" | http://api.easyhomelink.org/v1/device/DEV_ID/sensor/SEN_ID |- | style="background:#dee7ec" | Formats | style="background:#ffffff" | JSON |- | style="background:#dee7ec" | Methods | style="background:#ffffff" | DELETE |- | style="background:#dee7ec" | Returns | style="background:#ffffff" | 无 |} 例子: <pre> curl --request DELETE --header "UID: YOUR_UUID" http://api.easyhomelink.org/v1/device/5/sensor/1 </pre> <br><br>
返回到
Cloud Of Things API
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面