-
-
Notifications
You must be signed in to change notification settings - Fork 10
[blog] Add breaking change blog post for Light entity memory optimizations #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for esphome-dev-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive documentation for memory optimizations introduced in ESPHome 2025.11.0 for the Light entity class, focusing on two key changes: storing effect names in flash memory instead of heap, and using bitmasks instead of red-black trees for color mode storage.
- Documents breaking changes for effect name storage (std::string to const char*)
- Documents backward-compatible changes for color mode storage (std::set to ColorModeMask)
- Provides migration guide and examples for external component developers
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/blog/posts/2025-11-07-light-entity-optimizations.md | New blog post documenting Light entity memory optimizations with detailed migration guide |
| docs/blog/.authors.yml | Adds bdraco as a blog post author with maintainer credentials |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| auto effect = new MyEffect(EFFECT_NAME); | ||
|
|
||
| // 3. C arrays | ||
| static constexpr const char *const EFFECT_NAMES[] = {"Rainbow", "Pulse"}; |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The declaration uses both 'static constexpr' and 'const' keywords redundantly. For a constexpr array of string literals, 'static constexpr const char* const EFFECT_NAMES[]' is correct, but the outer 'const' after the asterisk is unnecessary since 'constexpr' already implies 'const'. Consider simplifying to 'static constexpr const char* EFFECT_NAMES[]'.
| static constexpr const char *const EFFECT_NAMES[] = {"Rainbow", "Pulse"}; | |
| static constexpr const char *EFFECT_NAMES[] = {"Rainbow", "Pulse"}; |
Summary
Adds blog post documenting breaking changes in Light entity class (esphome/esphome#11487, esphome/esphome#11348).
Breaking changes:
std::stringtoconst char*(saves string allocation overhead per effect) - External components likely affectedstd::set<ColorMode>toColorModeMask(~586 bytes for red-black tree overhead) - Mostly backward compatible (ColorModeMask provides .count(), .insert(), .erase() for std::set compatibility; no core components needed changes; breaking edge case: explicitly passing std::set to set_supported_color_modes() will fail)Blog post includes complete migration guide covering both changes, lifetime safety patterns for effect names, ColorModeMask usage details, and grep commands. Includes: