test: add discovery coverage for Smart Kettle variants - #349
Draft
bluetoothbot wants to merge 1 commit into
Draft
bluetoothbot wants to merge 1 commit into
bluetoothbot wants to merge 1 commit into
Conversation
Fill the empty YM-K1501 and V-SK152 stubs (vacuous passes since the 2022 import) and add a YM-K1501EU case. The Mi smart kettles broadcast no measurement objects over MiBeacon, so a shared helper synthesizes an unencrypted V4 discovery beacon (object_include=0) and asserts each registered product_id (0x0083/0x0113/0x045C) is identified as a Smart Kettle. Guards the device registrations against accidental removal.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #349 +/- ##
=======================================
Coverage 59.41% 59.41%
=======================================
Files 7 7
Lines 1412 1412
Branches 278 278
=======================================
Hits 839 839
Misses 444 444
Partials 129 129 ☔ View full report in Codecov by Harness. 🚀 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.
What
Fill the empty
YM-K1501/V-SK152test stubs and add aYM-K1501EUcase, giving the three registered Smart Kettle product IDs real discovery coverage.Why
These stubs have been vacuous passes since the 2022 import — they pass without asserting anything, so they hide regressions (e.g. an accidental removal of the kettle registrations in
devices.pywould go unnoticed). The Mi smart kettles broadcast no measurement objects over MiBeacon, so the parser can only identify them; there was no test proving even that worked.How
A shared
_assert_kettle_discoveryhelper synthesizes an unencrypted MiBeacon V4 discovery beacon (frctrl 0x4010,object_include=0) for each product ID (0x0083/0x0113/0x045C) and asserts the device issupported()and identified as a "Smart Kettle". Same discovery-only pattern astest_Xiaomi_ESM787_discovery. No parser changes — pure test coverage.Testing
poetry run pytest tests/test_parser.py→ 133 passed. black/isort/flake8 clean.Quality Report
Changes: 1 file changed, 53 insertions(+)
Code scan: clean
Tests: failed (FAILED)
Branch hygiene: clean
Generated by Kōan