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
| Parameter | Type | Required | Description |
|---|---|---|---|
temperature | number | Yes | Raw 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
type
ConvertValue| Property | Type | Description |
|---|---|---|
value | number | Value |
unit | string | Unit |
Examples
Example
Notes
- This method detects whether advanced color temperature is enabled.
- If advanced capability is off, it returns the raw value and an empty unit.
- On Matter devices,
color_temp_controlis used for conversion. - On standard protocol devices,
temp_valueis used for conversion. - Conversion uses a cloud API; network is required.