addAstronomical
添加天文定时。
请求参数
| 参数 | 数据类型 | 说明 | 是否必填 |
|---|---|---|---|
| bizId | String | 设备 ID 或群组 ID | 是 |
| bizType | Integer | 0:设备;1:设备群组 | 是 |
| loops | String | 周期: '1111111' | 是 |
| dps | String | dp 点,json 格式 | 是 |
| astronomicalType | Integer | 天文类型, 0:日出;1:日落 | 是 |
| timezone | String | 时区 | 是 |
| date | String | yyyyMMdd | 否 |
| time | String | 偏移时间,"HH:mm" 24 进制 | 是 |
| offsetType | Integer | 偏移类型,-1:向前; 0:正常;1:向后 | 是 |
| lon | Double | 经度 | 是 |
| lat | Double | 纬度 | 是 |
返回参数
| 参数 | 数据类型 | 说明 |
|---|---|---|
| response | Number | 新添加天文定时的 ID |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
请求示例
import { addAstronomical } from '@ray-js/ray';
addAstronomical({
astronomicalType: 1,
bizId: 'vdevo160456552237748',
bizType: 0,
dps: {
1: true,
},
lat: 30.300694,
lon: 120.068634,
loops: '1111111',
offsetType: -1,
time: '00:04',
timezone: '+08:00',
})
.then((response) => {
console.log(response);
})
.catch();
返回示例
10125352;
getAstronomicalList
获取天文定时列表。
请求参数
| 参数 | 数据类型 | 说明 | 是否必填 |
|---|---|---|---|
| bizId | String | 设备 ID 或群组 ID | 是 |
返回参数
| 参数 | 数据类型 | 说明 |
|---|---|---|
| astronomicalType | Number | 日出日落类型 |
| bizId | String | 设备或群组 ID |
| bizType | Number | 资源类型。0:单设备;1:群组设备。 |
| dps | Dps[] | DP 值 |
| id | Number | 定时任务 ID |
| lat | Number | 纬度 |
| lon | Number | 经度 |
| loops | String | 周循环 |
| nextSunRise | String | 下一个日出时间 |
| offsetType | Number | 定时偏移执行类型 |
| status | Number | 定时任务状态,0 关闭,1 开启,2 无效/已删除 |
| time | String | 定时时间 |
| timezone | String | 时区 |
请求示例
import { getAstronomicalList } from '@ray-js/ray';
getAstronomicalList({
bizId: 'vdevo160456552237748',
})
.then((response) => {
console.log(response);
console.log(JSON.stringify(response));
})
.catch();
返回示例
{
"categoryStatus": 1,
"id": "000000d5c3",
"category": "category",
"timers": [
{
"status": 0,
"loops": "0000000",
"time": "09:40",
"id": 6281604,
"isAppPush": false,
"dps": "{\"1\":true,\"2\":false}",
"groupOrder": 0,
"groupId": "00000148os",
"aliasName": "xxxxxx"
},
{
"status": 0,
"loops": "0000000",
"time": "09:40",
"id": 9442186,
"isAppPush": false,
"dps": "{\"1\":true,\"2\":false}",
"groupOrder": 0,
"groupId": "0000029kfp",
"aliasName": "xxxxxx"
},
{
"status": 0,
"loops": "0000000",
"time": "17:40",
"id": 6280599,
"isAppPush": true,
"dps": "{\"1\":true,\"2\":false}",
"groupOrder": 0,
"groupId": "00000147x1",
"aliasName": "xxxxxx"
},
{
"status": 0,
"loops": "0000000",
"time": "17:40",
"id": 6281557,
"isAppPush": true,
"dps": "{\"1\":true,\"2\":false}",
"groupOrder": 0,
"groupId": "00000148nu",
"aliasName": "xxxxxx"
},
{
"status": 0,
"loops": "0000000",
"time": "17:40",
"id": 9441872,
"isAppPush": true,
"dps": "{\"1\":true,\"2\":false}",
"groupOrder": 0,
"groupId": "0000029jin",
"aliasName": "xxxxxx"
},
{
"status": 1,
"loops": "0000000",
"time": "17:40",
"id": 10123021,
"isAppPush": true,
"dps": "{\"1\":true,\"2\":false}",
"groupOrder": 0,
"groupId": "000002hp0i",
"aliasName": "xxxxxx"
},
{
"status": 0,
"loops": "0000000",
"time": "21:00",
"id": 6281603,
"isAppPush": false,
"dps": "{\"1\":true,\"2\":false}",
"groupOrder": 1,
"groupId": "00000148os",
"aliasName": "xxxxxx"
},
{
"status": 0,
"loops": "0000000",
"time": "21:00",
"id": 9442187,
"isAppPush": false,
"dps": "{\"1\":true,\"2\":false}",
"groupOrder": 1,
"groupId": "0000029kfp",
"aliasName": "xxxxxx"
}
]
}
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
&spm=1001.2101.3001.5002&articleId=139412700&d=1&t=3&u=675c11115ede4749b910c309885f5771)

被折叠的 条评论
为什么被折叠?



