1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 22:18:40 +00:00

Handle Modalias missing from the bluetooth adapter details on older BlueZ (#78715)

This commit is contained in:
J. Nick Koston
2022-09-18 20:09:45 -05:00
committed by GitHub
parent 1f92804211
commit 9655f30146
4 changed files with 73 additions and 2 deletions

View File

@@ -97,3 +97,27 @@ def two_adapters_fixture(bluez_dbus_mock):
},
):
yield
@pytest.fixture(name="one_adapter_old_bluez")
def one_adapter_old_bluez(bluez_dbus_mock):
"""Fixture that mocks two adapters on Linux."""
with patch(
"homeassistant.components.bluetooth.platform.system", return_value="Linux"
), patch(
"homeassistant.components.bluetooth.scanner.platform.system",
return_value="Linux",
), patch(
"homeassistant.components.bluetooth.util.platform.system", return_value="Linux"
), patch(
"bluetooth_adapters.get_bluetooth_adapter_details",
return_value={
"hci0": {
"org.bluez.Adapter1": {
"Address": "00:00:00:00:00:01",
"Name": "BlueZ 4.43",
}
},
},
):
yield