On this page

Usage

Single deviceGroup support
Info

The lamp advanced capability SDK standardizes:

  • Whether advanced capabilities are enabled
  • Color temperature value and unit conversion
  • Brightness value and unit conversion
  • VAS keypoint information

Get started

SmartLampAdvancedAbility has been available since @ray-js/panel-sdk@1.15.0.

SmartLampAdvancedAbility(props: SmartLampAdvancedAbilityOptions)

Requires:
≥1.15.0

Description

Advanced lighting capability that provides advanced conversion for color temperature/brightness and VAS information queries

Parameters

ParameterTypeRequiredDescription
YesInitialization configuration for advanced lighting capability

Return Value

Type: SmartLampAdvancedAbility
SmartLampAdvancedAbility instance

Methods

MethodDescription
convertTemperatureConvert color temperature value: if the device has the advanced color temperature capability enabled, return a display value with unit (e.g., 2700K); otherwise return the raw value and an empty unit.
convertBrightnessConvert brightness value: if the device has the thousandth-level brightness capability enabled, return a display value with unit; otherwise return the raw value and an empty unit.
getAdvancedTemperatureVasGet advanced color temperature VAS (value-added service) info, including keypoints (display value, raw value, unit) for color-temperature range and display.
getAdvancedBrightnessVasGet advanced brightness (thousandth-level) VAS info, including keypoints, for brightness range and unit display.
getAdvanceHighEnabledCheck whether the specified DP’s advanced capability is enabled: supports bright_value (thousandth-level brightness), temp_value (standard color temperature), color_temp_control (Matter color temperature).
convertDpConvert a raw DP value to a display value with unit by DP; supports bright_value, temp_value, color_temp_control.

Examples

Example

import { SmartDeviceModel, SmartLampAdvancedAbility } from '@ray-js/panel-sdk';

const sdm = new SmartDeviceModel({ abilities: [new SmartLampAdvancedAbility({})] });