Features - Light Strip Painting

Function Introduction

  • The light strip painting capability is mainly used for light strip categories, allowing users to customize the coloring of the light strip to enrich the playability of the light strip.
  • The DP color value of the graffiti color light adopts the HSV color model, and the string value corresponding to the HSV model color is sent through the panel.
  1. Hue (H) Hue adjustment range: 0-360, the range of the value sent by the panel is 0-360, and the color ring adjustment range and the value sent by the panel are in a linear correspondence.
  2. Saturation (S) Saturation adjustment range: 0%-100%, the range of the value sent by the panel is 0-1000, and the color ring adjustment range and the value sent by the panel are in a linear correspondence.
  3. Brightness (V) Brightness adjustment range: 1%-100%, the value range sent by the panel is 10-1000, and the color wheel adjustment range and the value sent by the panel are linearly corresponding.

DP protocol


DP codeDP meaningDP typeRemarks
paint_colour_dataColor light smear DP{ "type": "raw", "maxlen": 255 }

  • paint_colour_data DP details
Version numberAdjustment modeAdjustment effectSegment numberData
1byte1byte1byte1byteSee the table below
0x000x00: White light mode 0x01: Color light mode 0x02: Color card mode 0x03: Combination mode0x00: No effect 0x01: Transition between segments 0x02: Flashing 0x03: Breathing 0x04: ShiningNumber of light strip segmentsSee the table below
  • White light mode:
Adjustment actionB brightnessT color temperature
1byte2byte2byte
0x00: Paint bucket0-10000-1000
  • Color light, color card mode:
Adjustment actionHSVSegment selectionData 1Data 2Data x...
1byte6byte1byte1byte1byte...
0x00: Paint bucket 0X01: Pencil (click) 0X02: Eraser (eraseColor light HSV color value (2+2+2)7bit: (0: continuous; 1: discontinuous) 0bit-6bit: (when continuous, meaningless; when discontinuous, represents the total number of segments)Continuous: start number Discontinuous: segment numberContinuous: end number Discontinuous: segment number...
  • Combination mode
Combination mode (reserved)Color 1Color 2...
1byte6byte6byte...
0x00: UniformColor light HSV color value (2+2+2)Color light HSV color value (2+2+2)...

How to develop

Notes

  • Apply the UI implementation of the light strip:
    1. Canvas/SVG + collision detection can be used in the applet to achieve this.
    2. In RN, the corresponding image is used to dynamically modify the color and its gradient color.
  • Problems with synchronizing the status of the light strip and the device
    1. Because the DP point only saves the data of the most recent application, the data of white light and color light needs to be stored in the cloud (separate storage is recommended) to synchronize the status of the panel and the device
    2. When the button or remote control operates the lamp, listen to the DP status synchronization