SmartLampAdvancedAbility.convertBrightness(brightness: number)

Requires:
≥1.15.0

Description

Convert 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.

Parameters

ParameterTypeRequiredDescription
brightnessnumberYesRaw brightness value (typical range e.g., 10-1000)

Return Value

Type: ConvertValue
Converted value and unit; unit is an empty string when the advanced capability is not enabled. Depends on a cloud API; network required.

Referenced Types

typeConvertValue
PropertyTypeDescription
valuenumberValue
unitstringUnit

Examples

Example

const result = await sdm.lampAdv.convertBrightness(100);
console.log('Brightness:', result.value, result.unit);

Notes

  1. This method detects whether thousandth brightness is enabled.
  2. If advanced capability is off, it returns the raw value and an empty unit.
  3. Conversion uses a cloud API; network is required.
  4. Brightness range is typically 10–1000 (thousandth brightness).