Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Handling retired or changed scanners #360

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions custom_components/bermuda/bermuda_device_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,15 @@ def update_advertisement(self, scandata: BluetoothScannerDevice):
# I want to know if it does.
# AJG 2024-01-11: This does happen. Looks like maybe apple devices?
# Changing from warning to debug to quiet users' logs.
_LOGGER.debug(
"Device changed TX-POWER! That was unexpected: %s %sdB",
self.parent_device_address,
scandata.advertisement.tx_power,
)
# Also happens with esphome set with long beacon interval tx, as it alternates
# between sending some generic advert and the iBeacon advert. ie, it's bogus for that
# case.
# _LOGGER.debug(
# "Device changed TX-POWER! That was unexpected: %s %sdB",
# self.parent_device_address,
# scandata.advertisement.tx_power,
# )
pass
self.tx_power = scandata.advertisement.tx_power

# Track each advertisement element as or if they change.
Expand Down
2 changes: 2 additions & 0 deletions custom_components/bermuda/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
PRUNE_TIME_DEFAULT = 259200 # Max age of regular device entries (3days)
PRUNE_TIME_IRK = 3600 # Resolvable Private addresses change often, prune regularly (1h)

SAVEOUT_COOLDOWN = 10 # seconds to delay before re-trying config entry save.

DOCS = {}


Expand Down
Loading
Loading