refactor: complete LED type system simplification
This commit is contained in:
@ -150,12 +150,12 @@ const LedCountControlItem: Component<LedCountControlItemProps> = (props) => {
|
||||
<div class="mt-1">
|
||||
<select
|
||||
class="select select-xs w-full text-xs h-6 min-h-0"
|
||||
value={config()?.led_type || LedType.RGB}
|
||||
value={config()?.led_type || LedType.WS2812B}
|
||||
onChange={handleLedTypeChange}
|
||||
title={t('ledConfig.ledType')}
|
||||
>
|
||||
<option value={LedType.RGB}>RGB</option>
|
||||
<option value={LedType.RGBW}>RGBW</option>
|
||||
<option value={LedType.WS2812B}>WS2812B</option>
|
||||
<option value={LedType.SK6812}>SK6812</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,7 +29,7 @@ export const LedStripTest = () => {
|
||||
const [boards, setBoards] = createSignal<BoardInfo[]>([]);
|
||||
const [selectedBoard, setSelectedBoard] = createSignal<BoardInfo | null>(null);
|
||||
const [ledCount, setLedCount] = createSignal(60);
|
||||
const [ledType, setLedType] = createSignal<'RGB' | 'RGBW'>('RGB');
|
||||
const [ledType, setLedType] = createSignal<'WS2812B' | 'SK6812'>('WS2812B');
|
||||
const [isRunning, setIsRunning] = createSignal(false);
|
||||
const [currentPattern, setCurrentPattern] = createSignal<TestPattern | null>(null);
|
||||
const [animationSpeed, setAnimationSpeed] = createSignal(33); // ~30fps
|
||||
@ -256,13 +256,13 @@ export const LedStripTest = () => {
|
||||
<label class="label">
|
||||
<span class="label-text">LED Type</span>
|
||||
</label>
|
||||
<select
|
||||
<select
|
||||
class="select select-bordered w-full"
|
||||
value={ledType()}
|
||||
onChange={(e) => setLedType(e.target.value as 'RGB' | 'RGBW')}
|
||||
onChange={(e) => setLedType(e.target.value as 'WS2812B' | 'SK6812')}
|
||||
>
|
||||
<option value="RGB">RGB</option>
|
||||
<option value="RGBW">RGBW</option>
|
||||
<option value="WS2812B">WS2812B</option>
|
||||
<option value="SK6812">SK6812</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Borders } from '../constants/border';
|
||||
|
||||
export enum LedType {
|
||||
RGB = 'RGB',
|
||||
RGBW = 'RGBW',
|
||||
WS2812B = 'WS2812B',
|
||||
SK6812 = 'SK6812',
|
||||
}
|
||||
|
||||
export type LedStripPixelMapper = {
|
||||
@ -29,6 +29,6 @@ export class LedStripConfig {
|
||||
public readonly display_id: number,
|
||||
public readonly border: Borders,
|
||||
public len: number,
|
||||
public led_type: LedType = LedType.RGB,
|
||||
public led_type: LedType = LedType.WS2812B,
|
||||
) {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user