You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changed the entities in this integration to be either EntityCategory.DIAGNOSTIC or EntityCategory.CONFIGURATION. This makes it a much friendlier integration with things like the mushroom dashboard generator - no longer do you get dozens of random switches and stuff for controlling your keymaster, just because you gave your lock an area, and then asked to generate a dashboard for said area.
Breaking change
It might break someone who expected to see keymaster entities in a dashboard and are using something like a smart filter, filtering out diagnostic and config entities. It does not break the generated keymaster dashboards or the keymaster dashboard strategy as far as I can tell.
Proposed change
Change all the entities of various types by assigning an EntityCategory of either DIAGNOSTIC or CONFIGURATION. No doubt people might argue with my particular choices here - I'm not super fussy, I just wanted all these useful entities to not pollute autogenerated dashboards anymore.
Type of change
Dependency upgrade
Bugfix (non-breaking change which fixes an issue)
New feature (which adds functionality)
Breaking change (fix/feature causing existing functionality to break)
Code quality improvements to existing code or addition of tests
Additional information
This PR fixes or closes issue: none that I can find
I used codex to help identify the exact spots to add the changes (I have spent months figuring this out as well, but heyho, it did it in 10 minutes), they are minimal in nature and the tests seem to pass. I am running this code in my local HASS instance and nothing has broken.
Hi @cpw — thanks so much for opening this! Welcome to the project, this is a really nice contribution and the motivation is spot on. Dashboard auto-generators pulling in dozens of switches is a real pain point.
Two things from my side:
1. Push back on event.py → DIAGNOSTIC
Functionally nothing breaks (recorder still records, automations still trigger, logbook still receives entries), but EntityCategory.DIAGNOSTIC will demote event entities in the device page and exclude them from any auto-dashboard logic that filters diagnostics.
The reason I'd push back: HA event entities were introduced specifically as the first-class surface for "this thing happened" on devices like door locks — they're meant to be the user-visible artifact of an unlock-by-PIN. Hiding them by default arguably defeats their purpose. Power users typically want to see "Code Slot 3 unlocked the door" prominently in dashboards.
Would you be open to leaving KeymasterEvent with no category (i.e. revert just the event.py change), keeping it as a primary entity? Everything else in the PR looks well-categorized to me.
2. CI: prek failure
The Prek check failed because ruff check found and auto-fixed an import-ordering issue in tests/test_time.py (the new EntityCategory import was placed before homeassistant.core, breaking alphabetical order):
To fix locally and avoid this in the future, please install prek (preferred — much faster Rust-based runner, fully compatible with .pre-commit-config.yaml) or pre-commit if you'd rather stick to the original:
# Recommended: prek (faster, drop-in replacement)
pipx install prek
prek install
prek run --all-files
# Or: classic pre-commit
pipx install pre-commit
pre-commit install
pre-commit run --all-files
Then commit the auto-fix and push. The hook will catch the same issue automatically on future commits.
Again, thanks for the PR! Once those two items are addressed I'll happily approve.
tykeal
changed the title
Make entities either DIAGNOSTIC or CONFIGURATION, to help with dashboard generators
refactor: Make entities either DIAGNOSTIC or CONFIGURATION
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changed the entities in this integration to be either EntityCategory.DIAGNOSTIC or EntityCategory.CONFIGURATION. This makes it a much friendlier integration with things like the mushroom dashboard generator - no longer do you get dozens of random switches and stuff for controlling your keymaster, just because you gave your lock an area, and then asked to generate a dashboard for said area.
Breaking change
It might break someone who expected to see keymaster entities in a dashboard and are using something like a smart filter, filtering out diagnostic and config entities. It does not break the generated keymaster dashboards or the keymaster dashboard strategy as far as I can tell.
Proposed change
Change all the entities of various types by assigning an EntityCategory of either DIAGNOSTIC or CONFIGURATION. No doubt people might argue with my particular choices here - I'm not super fussy, I just wanted all these useful entities to not pollute autogenerated dashboards anymore.
Type of change
Additional information
I used codex to help identify the exact spots to add the changes (I have spent months figuring this out as well, but heyho, it did it in 10 minutes), they are minimal in nature and the tests seem to pass. I am running this code in my local HASS instance and nothing has broken.