feature: add invert_condition option for inverted rendering of tiles - #79
Conversation
Tile widgets gain invert_condition — a list of Lovelace card conditions (same format and evaluator as the visibility field). When non-empty and all conditions are met, the tile renders as a solid black card with white text/icon, with the icon forced to the flat no-circle glyph. On grayscale e-ink panels a full-tile inversion is an unmissable attention signal, where the default active-state icon tint reads as lower contrast than the inactive state. The editor gains an Invert conditions panel on tile widgets, built on the same ha-card-conditions-editor wrapper as the Visibility panel (generalized into _buildConditionsPanel). The ha-form value-changed handler now also preserves invert_condition, which ha-form would otherwise drop on any edit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RdcF9h4rCMcnKeHWMBdrW
|
Thank you very much for your contribution. I'm not very happy with the Tile widget yet. I think we need to think about a redesign for eink displays. Where to put icons, labels, values ... |
|
My pleasure. Thanks for that great integration! Its straight-forward to use and I like the freedom of pixel-accurate placement of elements. I agree that it's not easy to find a good design-language for epaper. Since we do not have color (usually) I think we need to work with contrast instead if we want to make things pop that need to catch attention at a glance. Another much simpler option to my full inversion approach: you could just increas the contrast of the "on" state icon. Make it white icon on full a full black circle. This is currently a filled gray circle, which does not provide that much contrast to the white icon and other gray elements on the dashboard. But then again, sometimes you maybe dont want to have that "alert, look at me" look, but only want to show the current state - for which the gray is perfectly fine. For the PR: any changes you want to see or do you prefer to not merge at all and instead go for a redesign entirely? |
|
The MR looks fine to me. I will merge it. Just wanted to let you know that I'm open for redesign ideas :-) I also plan to support color displays in future. reTerminal 1002 is one for example. But first I want to have the grayscale working before adding color support. |
Add
invert_conditionoption for inverted rendering of tilesinvert_conditionon tile widgets. When non-empty andall conditions are met, the tile renders inverted (solid black card, white
text/icon, flat no-circle glyph)
and the default tinted icon circle reads as lower contrast when active.
panel builder was generalized into a shared
_buildConditionsPanel().ha-card-conditions-editor;value-changedhandlerdrops widget keys ha-form doesn't manage;
invert_conditionis nowpreserved like
visibilityandentries.test_render_tile.py), 8 new vitest cases(editor panel, write-back, preservation). Full suites pass: pytest 1040,
ruff, ty, interrogate, tsc, vitest 110.
Screenshots
UI
Condition not met
Condition met