Skip to content

Fix notify actions reported as unknown entities#1333

Draft
frenckatron wants to merge 1 commit into
mainfrom
frenckatron/fix-notify-entity-repair-1331
Draft

Fix notify actions reported as unknown entities#1333
frenckatron wants to merge 1 commit into
mainfrom
frenckatron/fix-notify-entity-repair-1331

Conversation

@frenckatron

Copy link
Copy Markdown
Collaborator

Description

This filters called services/actions out of the entity-reference repair path before unknown entities are reported.

Home Assistant can expose action names such as notify.my_phone through referenced_entities. Those action names look like entity IDs, but they are service calls, not entities. Spook now subtracts the called services from the automation and script config before filtering for unknown entity references.

Motivation and Context

Fixes #1331.

Spook 5 could report notify actions and notify groups as unknown entities in automations and scripts. That created noisy repairs for valid action: notify.* calls.

How has this been tested?

uv run pytest tests/ectoplasms/automation/repairs/test_unknown_entity_references.py tests/ectoplasms/script/repairs/test_unknown_entity_references.py tests/test_entity_filtering.py -q
uv run ruff format --check custom_components/spook/entity_filtering.py custom_components/spook/ectoplasms/automation/repairs/unknown_entity_references.py custom_components/spook/ectoplasms/script/repairs/unknown_entity_references.py tests/ectoplasms/automation/repairs/test_unknown_entity_references.py tests/ectoplasms/script/repairs/test_unknown_entity_references.py
uv run ruff check --output-format=github custom_components/spook/entity_filtering.py custom_components/spook/ectoplasms/automation/repairs/unknown_entity_references.py custom_components/spook/ectoplasms/script/repairs/unknown_entity_references.py tests/ectoplasms/automation/repairs/test_unknown_entity_references.py tests/ectoplasms/script/repairs/test_unknown_entity_references.py
uv run --with pre-commit pre-commit run pylint --files custom_components/spook/entity_filtering.py custom_components/spook/ectoplasms/automation/repairs/unknown_entity_references.py custom_components/spook/ectoplasms/script/repairs/unknown_entity_references.py tests/ectoplasms/automation/repairs/test_unknown_entity_references.py tests/ectoplasms/script/repairs/test_unknown_entity_references.py

Screenshots (if appropriate):

Not applicable.

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.

@frenckatron frenckatron added the bugfix Inconsistencies or issues which will cause a problem for users or implementors. label Jun 24, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ccab7639-1985-4b21-ba68-8ba57eb01046

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch frenckatron/fix-notify-entity-repair-1331

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.

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All "notify" entities flagged as unknown

1 participant