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
| Parameter | Type | Required | Description |
|---|---|---|---|
brightness | number | Yes | Raw 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
type
ConvertValue| Property | Type | Description |
|---|---|---|
value | number | Value |
unit | string | Unit |
Examples
Example
Notes
- This method detects whether thousandth brightness is enabled.
- If advanced capability is off, it returns the raw value and an empty unit.
- Conversion uses a cloud API; network is required.
- Brightness range is typically 10–1000 (thousandth brightness).