Skip to content

fix: leak detector with passive scanning.#512

Open
avian2 wants to merge 1 commit into
sblibs:masterfrom
avian2:fix-leak-passive
Open

fix: leak detector with passive scanning.#512
avian2 wants to merge 1 commit into
sblibs:masterfrom
avian2:fix-leak-passive

Conversation

@avian2

@avian2 avian2 commented Jun 6, 2026

Copy link
Copy Markdown

Remove unnecessary check for data (containing service data). Service data is absent in passive scans. Later parsing code only uses mfr_data anyway so this check does not appear necessary.

I am not sure why the ckeck was there. The presence of a test suggests that it was intentional as if the sensor did not send valid mfr_data in passive scans and mfr_data should only be parsed in an active scan.

However my Switchbot leak detectors (bought July 2025 and April 2026) do send usable battery and leak bits in mfr_data also in passive scans so this check seems unnecessary and prevents me from using parse_advertisement_data in my setup.

Remove unnecessary check for data (containing service data). Service
data is absent in passive scans. Later parsing code only uses mfr_data
anyway so this check does not appear necessary.

I am not sure why the ckeck was there. The presence of a test suggests that
it was intentional as if the sensor did not send valid mfr_data in
passive scans and mfr_data should only be parsed in an active scan.

However my Switchbot leak detectors (bought July 2025 and April 2026) do
send usable battery and leak bits in mfr_data also in passive scans so
this check seems unnecessary and prevents me from using
parse_advertisement_data in my setup.
@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
switchbot/adv_parsers/leak.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant