getSceneList

Requires:
@ray-js/ray≥1.4.61

Method signature
getSceneList(params: )

Description

Query the Tap-to-Run scenes supported by the device, including invalid and automation rules

Parameters

ParameterTypeRequiredDescription
YesQuery parameters

Return Value

Type: Promise<ISceneListItem[]>
Automation rule list

Referenced Types

interfaceISceneListItem
PropertyTypeDescription
actionsany[]Execution action
attributenumberAttributes
auditStatusnumberReview status
backgroundstringBackground image URL
boundForPanelbooleanPanel binding
boundForWiFiPanelbooleanWiFi panel binding
codestringRule code
commonFieldstringCommon fields
coverIconstringIcon
disableTimenumberDisable time
displayColorstringBackground color
enabledtrueWhether the rule is enabled
devIdstringDevice ID
namestringAutomation name
idstringExecution rule ID

Examples

import { getSceneList } from '@ray-js/ray';

const fetchScenes = async () => {
  try {
    const scenes = await getSceneList({
      devId: 'device_001',
      gid: '12345678',
    });
    console.log('Scene list:', scenes);
  } catch (err) {
    console.error('Query failed:', err);
  }
};