Files
ledgrab/TODO.md
T
alexei.dolgolyov 4940007e54
Lint & Test / test (push) Successful in 2m19s
feat: add Group device type for combining multiple devices
Introduces a new "group" device type that aggregates multiple physical
(or nested group) devices into one virtual device. Supports two modes:
- Sequence: LEDs concatenated end-to-end (led_count = sum of children)
- Independent: full pixel array resampled to each child independently

Includes cycle detection (DFS) to prevent circular group references,
delete protection for devices referenced by groups, recursive LED count
resolution for nested groups, and reorder controls (move up/down) for
child devices in the UI.

Backend: Device model, API schemas, GroupLEDClient, GroupDeviceProvider,
route validation, processing pipeline integration.
Frontend: type picker, child device picker with reorder, mode selector,
i18n (en/ru/zh), layers icon, CSS for group child rows.
Tests: 20 unit tests for cycle detection, LED count resolution, and
GroupLEDClient (sequence slicing, independent resampling, cleanup).
2026-04-11 02:26:56 +03:00

1.2 KiB

Group Device Type Implementation

Phase 1: Storage Layer

  • Add group_device_ids, group_mode fields to Device model
  • Add cycle detection + led_count resolution + group reference helpers to DeviceStore

Phase 2: API Schemas

  • Add group fields to DeviceCreate, DeviceUpdate, DeviceResponse

Phase 3: GroupLEDClient + Provider

  • Create group_client.py — GroupLEDClient (sequence slice / independent resample)
  • Create group_provider.py — GroupDeviceProvider
  • Register group provider in led_client.py

Phase 4: Routes + Processing Pipeline

  • Update device routes — group-specific create/update logic, delete protection, cycle validation
  • Add group fields to DeviceInfo + _DEVICE_FIELD_DEFAULTS
  • Pass group context (device_store, group fields) to create_led_client

Phase 5: Tests

  • Unit tests for cycle detection, led_count resolution, GroupLEDClient (20 tests, all passing)

Phase 6: Frontend

  • Group device UI (child picker, mode selector, hide URL for groups)
  • i18n keys (en, ru, zh)
  • TypeScript types + API helper
  • Icon (layers) for group device type
  • CSS for group child rows