---
name: "updateAstronomicalStatus"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "updateAstronomicalStatus - Enable or Disable Astronomical Timer"
---

## updateAstronomicalStatus

> [VERSION] @ray-js/ray >= 1.5.2

### Description

Modify the enable state of the astronomical timer

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `IUpdateAstronomicalStatus` | Yes | Request parameters |

### Return Value

Type: `Promise<boolean>`

Whether the status was updated successfully

### Referenced Types

##### `interface` IUpdateAstronomicalStatus

| Property | Type | Description |
| --- | --- | --- |
| `id` | `string` | Schedule ID |
| `status` | `number` | 0: off. 1: on |


### Examples

#### Basic usage

```ts
import { updateAstronomicalStatus } from '@ray-js/ray';

updateAstronomicalStatus({
  id: '8642566',
  status: 0,
}).then((response) => {
  console.log('Update status result:', response);
}).catch((err) => {
  console.error(err);
});
```
