createMatterKit(options?: CreateMatterKitOptions)

Requires:
≥1.15.0

Description

Create a matter-kit instance: provides an SDM interceptor, Matter ↔ standard DP conversion utilities, and hooks.

Parameters

ParameterTypeRequiredDescription
NoFactory input parameters; see

Return Value

Type: MatterKit
{MatterKit} matter-kit instance

Referenced Types

typeDpValueDatapoint value type, which can be boolean, number, or string.
export type DpValue = boolean | number | string;

Valid Values

CreateMatterKitOptions.shouldConvert.params.action
ValueDescriptionSince
init--
onDpDataChange--
onDeviceInfoUpdated--
dp-kit--

Examples

Example

import { SmartDeviceModel, createMatterKit } from '@ray-js/panel-sdk';
import { defaultSchema } from '@/devices/schema';

type SmartDeviceSchema = typeof defaultSchema;

export const matterKit = createMatterKit({ debug: false });
export const devices = {
  common: new SmartDeviceModel<SmartDeviceSchema>({
    interceptors: matterKit.interceptors,
  }),
};