Skip to content

Find unknown entities in heading badge#1173

Open
piitaya wants to merge 1 commit intofrenck:mainfrom
piitaya:unknown_entity_heading_badge
Open

Find unknown entities in heading badge#1173
piitaya wants to merge 1 commit intofrenck:mainfrom
piitaya:unknown_entity_heading_badge

Conversation

@piitaya
Copy link
Contributor

@piitaya piitaya commented Jan 20, 2026

Description

Add support for detecting unknown entity references in heading card badges.

Motivation and Context

The heading card supports a badges array where each badge can reference an entity and have tap/hold/double-tap actions. Previously, these entity references were not being detected by the "unknown entity references" repair.

Example heading card configuration:

type: heading
heading: "Living Room"
badges:
  - type: entity
    entity: sensor.temperature
    tap_action:
      action: more-info
      entity: sensor.temperature

How has this been tested?

Manual testing with a dashboard containing heading cards with badges that reference non-existent entities.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

The change extends unknown entity reference extraction by adding badge processing to Lovelace card handling. The code now identifies and aggregates entities from heading card badges alongside existing extraction methods, broadening the scope of detected entity dependencies.

Changes

Cohort / File(s) Summary
Heading card badge entity extraction
custom_components/spook/ectoplasms/lovelace/repairs/unknown_entity_references.py
Adds processing of config.get("badges") in __async_extract_entities_from_card method. For each badge dict, extracts entities via __async_extract_common(badge) and __async_extract_entities_from_actions(badge) to capture badge-referenced entities.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

enhancement

Suggested reviewers

  • frenck

Poem

🎃 A spook adds badges to the fray,
No unknown entities slip away,
Lovelace cards now fully gleam,
With references caught in extraction's beam! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Find unknown entities in heading badge' is directly related to the main change: adding detection of unknown entity references in heading card badges.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation, implementation details, and testing approach for detecting unknown entities in heading badge configurations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant