v0.2.2b1 — painter walk-up fix (beta)
Pre-releaseBeta. One fix on top of v0.2.1, shipped early to verify with HACS beta-channel users before promoting to GA. Drop-in upgrade — no schema change, no migration.
Bug fix
Some icons weren't being painted
The painter was reading `entity_id` directly from each ``'s `stateObj` property — fine for most surfaces (tile cards, more-info bodies, dev tools) but missing in others. Specifically, entities-card rows and more-info dialog headers wrap their icon in a `` that holds the entity's `stateObj` on the wrapper itself, passing only `data-domain` / `data-state` attributes down to the inner ``. The painter would find the icon, see no `stateObj.entity_id`, and bail — leaving the icon stuck on whatever color HA's default render produced.
Painter now walks up through parents (across shadow-root boundaries) to find the first ancestor with a populated `stateObj` when the immediate icon has none. A 12-hop guard keeps the lookup cheap; the wrapping element is always 1–2 hops away in practice.
The watcher-based color path was unaffected for cases that already worked (it was already keyed by entity_id), but the same walk now provides the entity_id input regardless of which surface the icon sits in.
What this means in practice
If you had Smart Icons rules whose colors only sometimes showed up — working on tile cards but not in the entities-card list, for example — they should now work everywhere.
Internals
- New `resolveStateObj()` helper in the painter.
- Regression test reproduces the user-reported DOM shape (state-badge with stateObj on the host, ha-state-icon inside its shadow root with only data-* attributes).
- Painter bundle: 3.3 KB → 3.6 KB. Panel bundle unchanged at 115.5 KB.
- 96 pytest + 68 Web Test Runner tests green; typecheck clean.
Upgrade
Drop-in from v0.2.1. Enable Show beta versions in HACS to pick it up.
Full Changelog: v0.2.1...v0.2.2b1