StripLocalTimerTransformer(uuid?: string, defaultValue?: ITimerData)

Requires:
@ray-js/panel-sdk≥1.0.0

Description

Light strip local timer protocol converter for bidirectional conversion between timer task data and the DP hexadecimal protocol

Parameters

ParameterTypeRequiredDescription
uuidstringNoDP identifier, defaults to 'strip_local_timer'
NoDefault timer data returned when parsing fails

Return Value

Type: StripLocalTimerTransformer
StripLocalTimerTransformer instance

Methods

MethodDescription
parserParse a DP hexadecimal string into a timer task data object
formatterFormat a timer task data object into a DP hexadecimal string

Examples

Example

import { StripLocalTimerTransformer } from '@ray-js/panel-sdk';

const transformer = new StripLocalTimerTransformer();
// Parse timer DP string
const timer = transformer.parser('1001e0021c0164006e');

// Format to DP string
const dpStr = transformer.formatter({
  id: 0,
  power: true,
  weeks: [1, 1, 1, 1, 1, 0, 0, 0],
  time: 480,
  mode: 2,
  lampPower: true,
  brightness: 1000,
  temperature: 500,
});