1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Fix timestamps for bluetooth scanners that bundle advertisements (#94511)

#94138 added support for raw/bundled advertisements. We should use the
same monotonic time for all advertisements in the bundle if not time
is passed, or calculate the timestamp and pass it if its known
This commit is contained in:
J. Nick Koston
2023-06-14 15:47:00 -10:00
committed by GitHub
parent 22dfa8797f
commit 2a5ffa9a5b
10 changed files with 42 additions and 8 deletions

View File

@@ -5,7 +5,11 @@ from bleak.backends.scanner import AdvertisementData, BLEDevice
from bluetooth_adapters import DEFAULT_ADDRESS
from homeassistant.components import bluetooth
from homeassistant.components.bluetooth import BaseHaRemoteScanner, HaBluetoothConnector
from homeassistant.components.bluetooth import (
MONOTONIC_TIME,
BaseHaRemoteScanner,
HaBluetoothConnector,
)
from homeassistant.core import HomeAssistant
from . import (
@@ -450,6 +454,7 @@ async def test_diagnostics_remote_adapter(
advertisement_data.manufacturer_data,
advertisement_data.tx_power,
{"scanner_specific_data": "test"},
MONOTONIC_TIME(),
)
with patch(