addAstronomical(params: IAstronomical)

Requires:
@ray-js/ray≥1.5.2

Description

Add astronomical timer

Parameters

ParameterTypeRequiredDescription
YesRequest parameters

Return Value

Type: Promise<number>
ID of the newly added astronomical timer

Examples

Basic usage

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('New astronomical timer ID:', response);
}).catch((err) => {
  console.error(err);
});