Skip to content

feat: add high-performance animation module#101

Merged
Djelibeybi merged 2 commits intomainfrom
feat/animation
Jan 24, 2026
Merged

feat: add high-performance animation module#101
Djelibeybi merged 2 commits intomainfrom
feat/animation

Conversation

@Djelibeybi
Copy link
Owner

@Djelibeybi Djelibeybi commented Jan 23, 2026

Adds animation module optimized for real-time effects at 30+ FPS:

Core features:

  • Direct UDP sending bypassing connection layer
  • Prebaked packet templates (zero allocation per frame)
  • Synchronous send_frame() for minimum overhead
  • Multi-tile canvas support for LIFX Tile devices
  • Automatic tile orientation remapping

Architecture:

  • Animator: High-level class with for_matrix/for_multizone factories
  • FrameBuffer: Canvas mapping and tile region extraction
  • PacketGenerator: Device-specific packet generation (Matrix/MultiZone)
  • PacketTemplate: Prebaked packets with color slot updates

Public API:

  • Exports Animator and AnimatorStats from main lifx package
  • Colors are provided as plain tuples: tuple[int, int, int, int]

@github-actions github-actions bot added documentation Improvements or additions to documentation tests examples size/xl labels Jan 23, 2026
@Djelibeybi Djelibeybi changed the title feat(animation): add high-performance animation module feat: add high-performance animation module Jan 23, 2026
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.30%. Comparing base (79a6612) to head (cd35cf4).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   91.66%   92.30%   +0.63%     
==========================================
  Files          45       50       +5     
  Lines        5254     5637     +383     
  Branches      649      692      +43     
==========================================
+ Hits         4816     5203     +387     
+ Misses        280      278       -2     
+ Partials      158      156       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Adds animation module optimized for real-time effects at 30+ FPS:

Core features:
- Direct UDP sending bypassing connection layer
- Prebaked packet templates (zero allocation per frame)
- Synchronous send_frame() for minimum overhead
- Multi-tile canvas support for LIFX Tile devices
- Automatic tile orientation remapping

Architecture:
- Animator: High-level class with for_matrix/for_multizone factories
- FrameBuffer: Canvas mapping and tile region extraction
- PacketGenerator: Device-specific packet generation (Matrix/MultiZone)
- PacketTemplate: Prebaked packets with color slot updates

Public API:
- Exports Animator and AnimatorStats from main lifx package
- Colors are provided as plain tuples: tuple[int, int, int, int]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Avi Miller <me@dje.li>
When device.capabilities was None, FrameBuffer.for_matrix() and
Animator.for_multizone() would skip capability checks instead of
loading capabilities first. This caused multi-tile LIFX Tile devices
to be treated as single-tile devices because has_chain was never
checked.

Now both methods call device._ensure_capabilities() when capabilities
is None, matching the pattern used in multizone.py.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Avi Miller <me@dje.li>
@Djelibeybi Djelibeybi merged commit 69e50b3 into main Jan 24, 2026
29 checks passed
@Djelibeybi Djelibeybi deleted the feat/animation branch January 24, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation examples size/xl tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant