Repository navigation
fix: point fixture sense product at an existing hub device - #172
Open
matt-thepie wants to merge 2 commits into
Open
matt-thepie wants to merge 2 commits into
matt-thepie wants to merge 2 commits into
Conversation
The sense product in src/data/data.json referenced a parent ID no device had, so file-mode sessions logged a KeyError for each sense entity and silently dropped the Glass, Smoke and Dog Bark binary sensors. Point it at the fixture hub and add a regression test that asserts a file-mode start_session logs no errors and discovers all three sense sensors. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #172 +/- ##
======================================
Coverage ? 99.96%
======================================
Files ? 30
Lines ? 2643
Branches ? 310
======================================
Hits ? 2642
Misses ? 0
Partials ? 1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The
senseproduct insrc/data/data.jsonpointed atparent-0000-0000-0000-000000000001, an ID no device in the fixture has. In file mode (username="use@file.com")HiveHelper.get_device_datadoesdevices[product["parent"]]for sense products, soadd_listcaught aKeyErrorand logged it three times, once per sense entity, and the Glass, Smoke and Dog Bark binary sensors were silently dropped fromdevice_list.hub-0000-0000-0000-000000000001, which is also the real-world shape (sense is a hub product).test_file_fixture_has_no_dangling_parentsstarts a file-mode session, asserts no ERROR log records, and asserts the three sense binary sensors are discovered. It fails on the old fixture and passes on the new one.No library code changes. Home Assistant is unaffected: the fixture is only used for offline testing.
Verification
pytest tests/: 1062 passed, coverage 100%.scripts/check_data_pii.py src/data/data.json: passed.start_sessionproduced 5 binary sensors and 3 ERROR logs. After: 8 binary sensors, no errors.🤖 Generated with Claude Code