Skip to content

Migrate entities and glance card state_color to color#53151

Open
piitaya wants to merge 2 commits into
devfrom
migrate-entities-glance-state-color
Open

Migrate entities and glance card state_color to color#53151
piitaya wants to merge 2 commits into
devfrom
migrate-entities-glance-state-color

Conversation

@piitaya

@piitaya piitaya commented Jul 16, 2026

Copy link
Copy Markdown
Member

Breaking change

The entities card now colors icons based on the entity state by default, like the glance, tile and button cards. Previously, only light icons were colored unless state_color: true was set. To restore the previous look, set color: none on the card.

For custom card developers: the color property of state-badge now follows the color API (state, none, theme colors applied while the entity is active) instead of being a raw CSS color applied unconditionally.

Proposed change

Migrates the entities and glance cards from the boolean state_color option to the color option (state, none or a color) already used by badges, heading badges and the button card. Replaces #52294.

  • state_color keeps working and is migrated to color when a card is edited, for the card and all built-in rows (custom rows are left untouched).
  • The color can now also be set per entity, both in YAML and in the editors, with the card value acting as the default.
  • state-badge is the single place resolving the color option; cards and rows just forward it.

Screenshots

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

To help with the load of incoming pull requests:

@piitaya piitaya added the Documentation Needed Docs need to be added to either the user or developer docs label Jul 16, 2026
@piitaya piitaya added the Breaking Change Needs Special Documentation to let users know about Change label Jul 16, 2026
@github-actions github-actions Bot added the Tests: Unit Related to Vitest unit tests label Jul 16, 2026
@piitaya
piitaya force-pushed the migrate-entities-glance-state-color branch from 60d58bd to 5b98151 Compare July 16, 2026 14:00
@piitaya piitaya removed the Documentation Needed Docs need to be added to either the user or developer docs label Jul 16, 2026
@dcapslock

Copy link
Copy Markdown
Contributor

Monitoring this 👀

@Mariusthvdb

Mariusthvdb commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Longstanding wish to have state_color: true be default.

Also for glance. So thanks for this.

Did you also think of picture-glance entities?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Change Needs Special Documentation to let users know about Change cla-signed Tests: Unit Related to Vitest unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants