Fix logbook spam by including image domain in ALWAYS_CONTINUOUS_DOMAINS#169240
Conversation
Fixes home-assistant#161039 where Roborock map image entities caused excessive Activity log entries during cleaning due to frequent state changes. Image entities use timestamps as state values and should be treated as continuous domains (like counter and proximity) to filter out redundant state change events from the logbook. Changes: - Add 'image' to ALWAYS_CONTINUOUS_DOMAINS in const.py - Update existing tests to include image domain - Add new test file test_image_continuous.py with comprehensive tests Co-authored-by: Claude Code <claude@anthropic.com>
There was a problem hiding this comment.
Hi @5-bean-curd
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
This PR updates Logbook’s “continuous domain” filtering so image entities are treated like other high-churn domains, reducing Activity/logbook noise from frequent image state updates (e.g., Roborock map timestamps).
Changes:
- Add
imagetoALWAYS_CONTINUOUS_DOMAINSso Logbook filters image state changes consistently across live streams and recorder queries. - Extend existing websocket API tests to include
imageentities in “always filtered” scenarios. - Add a new targeted test module covering inclusion in
ALWAYS_CONTINUOUS_DOMAINSand entity filtering behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| homeassistant/components/logbook/const.py | Adds image to the hardcoded always-continuous domain set used by Logbook filtering. |
| tests/components/logbook/test_websocket_api.py | Updates websocket stream/filtering tests to account for the new image continuous-domain behavior. |
| tests/components/logbook/test_image_continuous.py | Adds focused tests asserting image domain filtering expectations. |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Please address the bot review comments too.
- Update comment in const.py to mention image domain (Copilot suggestion) - Remove separate test module per maintainer request - Move image continuous domain tests to test_websocket_api.py - Test via public websocket API instead of private _is_state_filtered helper Fixes review comments from PR home-assistant#169240
There was a problem hiding this comment.
Hi @5-bean-curd
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
|
@MartinHjelmare Thanks for the review! I've addressed all the review comments:
All changes have been pushed. Please take another look when you have a chance! |
|
Please solve the CI issues. |
- Restore trailing newline in const.py (MartinHjelmare's suggestion) - Remove redundant test_image_entity_filtered_from_subscription (broken websocket timing logic; image filtering is already covered by the existing test_subscribe_all_entities_are_continuous and the parametrized test_consistent_stream_and_recorder_filtering) - Remove trivial test_image_in_always_continuous_domains (the parametrized test already implicitly validates this) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Hi @5-bean-curd
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
Done — restored the trailing newline. Sorry about that. |
@MartinHjelmare The only failing CI check is Run tests Python 3.14.2 (3), caused by a lingering task in tests/components/google_generative_ai_conversation/test_tts.py::test_tts_service_speak[service_data0] — unrelated to this PR. All logbook tests pass. Could you re-run the failing job? |
|
Please press the Ready for review button when ready for review and merge. |
|
@5-bean-curd I noticed now that you've changed the PR template to something that looks like an AI generated version influenced by our standard PR template. Please don't change the PR template in the future. Just fill it out appropriately. |
Proposed change
This PR adds the
imagedomain toALWAYS_CONTINUOUS_DOMAINSto prevent excessive logbook entries from image entities that frequently update their state.Fixes #161039
Type of change
Additional information
Problem
Roborock map image entities caused excessive Activity log entries during cleaning due to frequent state changes. Image entities use timestamps as state values and should be treated as continuous domains (like counter and proximity) to filter out redundant state change events.
Solution
imagetoALWAYS_CONTINUOUS_DOMAINSinhomeassistant/components/logbook/const.pytest_websocket_api.pyto include image domain in continuous domain test casesChecklist
ruff check.