智能小程序 Ray 开发天文定时 API 合集(一)

addAstronomical

添加天文定时。

请求参数

参数数据类型说明是否必填
bizIdString设备 ID 或群组 ID
bizTypeInteger0:设备;1:设备群组
loopsString周期: '1111111'
dpsStringdp 点,json 格式
astronomicalTypeInteger天文类型, 0:日出;1:日落
timezoneString时区
dateStringyyyyMMdd
timeString偏移时间,"HH:mm" 24 进制
offsetTypeInteger偏移类型,-1:向前; 0:正常;1:向后
lonDouble经度
latDouble纬度

返回参数

参数数据类型说明
responseNumber新添加天文定时的 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

获取天文定时列表。

请求参数

参数数据类型说明是否必填
bizIdString设备 ID 或群组 ID

返回参数

参数数据类型说明
astronomicalTypeNumber日出日落类型
bizIdString设备或群组 ID
bizTypeNumber资源类型。0:单设备;1:群组设备。
dpsDps[]DP 值
idNumber定时任务 ID
latNumber纬度
lonNumber经度
loopsString周循环
nextSunRiseString下一个日出时间
offsetTypeNumber定时偏移执行类型
statusNumber定时任务状态,0 关闭,1 开启,2 无效/已删除
timeString定时时间
timezoneString时区

请求示例

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 小程序开发。 

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IoT砖家涂拉拉

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值