bright2Number(bright: number, schemaObj: Record<string, DpSchema>)
Requires:
≥1.15.0
Description
Map Matter brightness_control range (1–254) to the standard bright_value (10–1000).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
bright | number | Yes | Matter brightness value (brightness_control) |
schemaObj | Record<string, DpSchema> | Yes | dpSchema object |
Return Value
Type: number
Standard-side bright_value (10–1000)
Referenced Types
interface
DpSchema| Property | Type | Required | Description |
|---|---|---|---|
attr | number | No | DP attribute flag bit, used to mark additional capabilities of the DP |
canTrigger | boolean | No | Whether it can be used as an automation trigger condition |
code | string | Yes | DP code, e.g., switch |
defaultRecommend | boolean | No | Whether it is the default recommended DP |
editPermission | boolean | No | Whether it has edit permission |
executable | boolean | No | Whether it can be issued (sent downstream) |
extContent | string | No | DP extension content, typically a JSON string |
iconname | string | No | DP icon name |
id | string | number | Yes | DP ID |
mode | "rw" | "ro" | "wr" | Yes | DP mode type rw: writable and reportable (read/write) ro: report-only (read-only) wr: write-only |
name | string | Yes | DP name, typically used in voice scenarios |
| No | DP attributes | ||
type | "raw" | "obj" | Yes | DP data type categories: raw for raw byte stream, obj for structured object |