Repository navigation
allow_ibeacon: scope rules by uuid - #3
Merged
Merged
Conversation
A rule could name a major and a minor but not a uuid - the matcher never
read the 16 uuid bytes. major/minor are small integers every vendor
starts counting from 1, so "major: 1" admitted anybody's beacon that was
left on its defaults, at that rule's own RSSI limit. On the fleet that
limit is -95, deliberately below the -90 floor so that probe-to-probe
calibration gets its weak cross-room readings; the same privilege went
to every foreign major-1 beacon in range. The config comment claiming
"every other iBeacon in range stays blocked" was true of other majors
and false of other uuids.
allow_ibeacon:
- uuid: fde3b150-2f64-43ba-aee9-867f75ee4a6f
major: 1
rssi: -95
- uuid is optional, so existing rules behave exactly as before. A rule
needs a uuid, a major, or both; a minor still needs a major. A
uuid-only rule covers every major/minor of that uuid.
- The two rule lists become one, kept most-specific-first (minor over
major over uuid-only, uuid-scoped over unscoped), so the winner no
longer depends on config order.
- A uuid that fails to parse drops the rule. It never widens to "any".
- The iBeacon uuid is transmitted in canonical order (checked against
esp32_ble_beacon), so it is a straight compare.
Tests (real source, ASan/UBSan): 14 new checks; the gate property test
now covers uuid-scoped rules (204,800 comparisons). Compiled on ESPHome
2026.9.0 (fork, esp32c3 rrn00, fleet config) and 2026.10.0-dev (hook
component); generated call verified:
add_ibeacon_rule("fde3b1502f6443baaee9867f75ee4a6f", 1, -1, -95).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
allow_ibeaconrules could name amajor/minorbut not auuid— the matcher never read the UUID bytes.major: 1is the commonest vendor default, so the fleet'smajor: 1, rssi: -95rule (deliberately below the floor, for probe calibration) forwarded anybody's major-1 beacon at −95 dBm.uuidis optional — existing rules are unchanged. Needs auuid, amajor, or both;minorstill needs amajor; uuid-only covers every major/minor of that UUID.Tests: 14 new checks against the real source under ASan/UBSan; gate property test extended (204,800 comparisons). Built: 2026.9.0 (fork, rrn00 C3, fleet config) and 2026.10.0-dev (hook). Same change in both repos; parity check green.
🤖 Generated with Claude Code