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

pull/78916/head
J. Nick Koston 2022-09-18 20:10:05 -05:00 committed by GitHub
parent da81dbe6ac
commit 933dde1d1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class AdapterDetails(TypedDict, total=False):
address: str
sw_version: str
hw_version: str
hw_version: str | None
passive_scan: bool

View File

@ -46,7 +46,7 @@ async def async_get_bluetooth_adapters() -> dict[str, AdapterDetails]:
adapters[adapter] = AdapterDetails(
address=adapter1["Address"],
sw_version=adapter1["Name"], # This is actually the BlueZ version
hw_version=adapter1["Modalias"],
hw_version=adapter1.get("Modalias"),
passive_scan="org.bluez.AdvertisementMonitorManager1" in details,
)
return adapters