Skip to content

Commit

Permalink
chore: Prevent warning about un-fresh source if it is not yet initial…
Browse files Browse the repository at this point in the history
…ised
  • Loading branch information
agittins committed May 8, 2024
1 parent 3a8d62d commit 7c4d8fe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion custom_components/bermuda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1509,12 +1509,20 @@ def update_metadevices(self):
# Source is newer than the latest recorded, update last_seen
metadev.last_seen = source_device.last_seen

elif source_device.last_seen == 0:
# _LOGGER.debug(
# "New source %s for %s has no stamp yet. This is"
# " expected if it's a fresh Private BLE source.",
# source_device.address,
# metadev.name
# )
pass
elif source_device.last_seen < metadev.last_seen:
# We should not have a source device that is older than the
# current metadevice, so flag this if it occurs.
# This caught bug #138, not that I realised it at the time!
# (https://github.com/agittins/bermuda/issues/138)
_LOGGER.warning(
_LOGGER.debug(
"Using freshest advert from %s for %s but it's still %s seconds too old!",
source_device.address,
metadev.name,
Expand Down

0 comments on commit 7c4d8fe

Please sign in to comment.