SmartLampAdvancedAbility.convertTemperature(temperature: number)

Requires:
≥1.15.0

Description

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

Parameters

ParameterTypeRequiredDescription
temperaturenumberYesRaw color temperature value (panel-side value, e.g., 2700)

Return Value

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

Referenced Types

typeConvertValue
PropertyTypeDescription
valuenumberValue
unitstringUnit

Examples

Example

const result = await sdm.lampAdv.convertTemperature(2700);
console.log('Color temperature:', result.value, result.unit);

Notes

  1. This method detects whether advanced color temperature is enabled.
  2. If advanced capability is off, it returns the raw value and an empty unit.
  3. On Matter devices, color_temp_control is used for conversion.
  4. On standard protocol devices, temp_value is used for conversion.
  5. Conversion uses a cloud API; network is required.