diff --git a/homeassistant/components/bluetooth/__init__.py b/homeassistant/components/bluetooth/__init__.py index be2d0d36fd7..8386178f459 100644 --- a/homeassistant/components/bluetooth/__init__.py +++ b/homeassistant/components/bluetooth/__init__.py @@ -10,10 +10,12 @@ from awesomeversion import AwesomeVersion from bluetooth_adapters import ( ADAPTER_ADDRESS, ADAPTER_HW_VERSION, + ADAPTER_MANUFACTURER, ADAPTER_SW_VERSION, DEFAULT_ADDRESS, AdapterDetails, adapter_human_name, + adapter_model, adapter_unique_name, get_adapters, ) @@ -276,6 +278,8 @@ async def async_update_device( config_entry_id=entry.entry_id, name=adapter_human_name(adapter, details[ADAPTER_ADDRESS]), connections={(dr.CONNECTION_BLUETOOTH, details[ADAPTER_ADDRESS])}, + manufacturer=details[ADAPTER_MANUFACTURER], + model=adapter_model(details), sw_version=details.get(ADAPTER_SW_VERSION), hw_version=details.get(ADAPTER_HW_VERSION), ) diff --git a/homeassistant/components/bluetooth/manifest.json b/homeassistant/components/bluetooth/manifest.json index 096b166d11c..bb090d2cf13 100644 --- a/homeassistant/components/bluetooth/manifest.json +++ b/homeassistant/components/bluetooth/manifest.json @@ -8,7 +8,7 @@ "requirements": [ "bleak==0.19.2", "bleak-retry-connector==2.8.5", - "bluetooth-adapters==0.8.0", + "bluetooth-adapters==0.11.0", "bluetooth-auto-recovery==0.5.2", "bluetooth-data-tools==0.3.0", "dbus-fast==1.75.0" diff --git a/homeassistant/components/nmap_tracker/manifest.json b/homeassistant/components/nmap_tracker/manifest.json index 6e7a9cbee53..a3e7ed50bd3 100644 --- a/homeassistant/components/nmap_tracker/manifest.json +++ b/homeassistant/components/nmap_tracker/manifest.json @@ -6,7 +6,7 @@ "requirements": [ "netmap==0.7.0.2", "getmac==0.8.2", - "mac-vendor-lookup==0.1.11" + "mac-vendor-lookup==0.1.12" ], "codeowners": [], "iot_class": "local_polling", diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 25efedf657a..13204a293d2 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -12,7 +12,7 @@ awesomeversion==22.9.0 bcrypt==3.1.7 bleak-retry-connector==2.8.5 bleak==0.19.2 -bluetooth-adapters==0.8.0 +bluetooth-adapters==0.11.0 bluetooth-auto-recovery==0.5.2 bluetooth-data-tools==0.3.0 certifi>=2021.5.30 diff --git a/requirements_all.txt b/requirements_all.txt index 2ac05ea8208..47cf17e93d3 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -447,7 +447,7 @@ bluemaestro-ble==0.2.0 # bluepy==1.3.0 # homeassistant.components.bluetooth -bluetooth-adapters==0.8.0 +bluetooth-adapters==0.11.0 # homeassistant.components.bluetooth bluetooth-auto-recovery==0.5.2 @@ -1055,7 +1055,7 @@ lw12==0.9.2 lxml==4.9.1 # homeassistant.components.nmap_tracker -mac-vendor-lookup==0.1.11 +mac-vendor-lookup==0.1.12 # homeassistant.components.magicseaweed magicseaweed==1.0.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 89b6fb6bbf1..12462c52496 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -361,7 +361,7 @@ blinkpy==0.19.2 bluemaestro-ble==0.2.0 # homeassistant.components.bluetooth -bluetooth-adapters==0.8.0 +bluetooth-adapters==0.11.0 # homeassistant.components.bluetooth bluetooth-auto-recovery==0.5.2 @@ -769,7 +769,7 @@ luftdaten==0.7.4 lxml==4.9.1 # homeassistant.components.nmap_tracker -mac-vendor-lookup==0.1.11 +mac-vendor-lookup==0.1.12 # homeassistant.components.maxcube maxcube-api==0.4.3 diff --git a/tests/components/bluetooth/conftest.py b/tests/components/bluetooth/conftest.py index c650a84df85..a6593adef49 100644 --- a/tests/components/bluetooth/conftest.py +++ b/tests/components/bluetooth/conftest.py @@ -106,6 +106,10 @@ def one_adapter_fixture(): "hw_version": "usb:v1D6Bp0246d053F", "passive_scan": True, "sw_version": "homeassistant", + "manufacturer": "ACME", + "product": "Bluetooth Adapter 5.0", + "product_id": "aa01", + "vendor_id": "cc01", }, }, ): @@ -132,12 +136,20 @@ def two_adapters_fixture(): "hw_version": "usb:v1D6Bp0246d053F", "passive_scan": False, "sw_version": "homeassistant", + "manufacturer": "ACME", + "product": "Bluetooth Adapter 5.0", + "product_id": "aa01", + "vendor_id": "cc01", }, "hci1": { "address": "00:00:00:00:00:02", "hw_version": "usb:v1D6Bp0246d053F", "passive_scan": True, "sw_version": "homeassistant", + "manufacturer": "ACME", + "product": "Bluetooth Adapter 5.0", + "product_id": "aa01", + "vendor_id": "cc01", }, }, ): @@ -164,6 +176,10 @@ def one_adapter_old_bluez(): "hw_version": "usb:v1D6Bp0246d053F", "passive_scan": False, "sw_version": "homeassistant", + "manufacturer": "ACME", + "product": "Bluetooth Adapter 5.0", + "product_id": "aa01", + "vendor_id": "cc01", }, }, ): diff --git a/tests/components/bluetooth/test_config_flow.py b/tests/components/bluetooth/test_config_flow.py index 76c0346026b..9219d37a399 100644 --- a/tests/components/bluetooth/test_config_flow.py +++ b/tests/components/bluetooth/test_config_flow.py @@ -130,7 +130,10 @@ async def test_async_step_integration_discovery(hass): """Test setting up from integration discovery.""" details = AdapterDetails( - address="00:00:00:00:00:01", sw_version="1.23.5", hw_version="1.2.3" + address="00:00:00:00:00:01", + sw_version="1.23.5", + hw_version="1.2.3", + manufacturer="ACME", ) result = await hass.config_entries.flow.async_init( @@ -159,7 +162,10 @@ async def test_async_step_integration_discovery_during_onboarding_one_adapter( ): """Test setting up from integration discovery during onboarding.""" details = AdapterDetails( - address="00:00:00:00:00:01", sw_version="1.23.5", hw_version="1.2.3" + address="00:00:00:00:00:01", + sw_version="1.23.5", + hw_version="1.2.3", + manufacturer="ACME", ) with patch( @@ -187,10 +193,16 @@ async def test_async_step_integration_discovery_during_onboarding_two_adapters( ): """Test setting up from integration discovery during onboarding.""" details1 = AdapterDetails( - address="00:00:00:00:00:01", sw_version="1.23.5", hw_version="1.2.3" + address="00:00:00:00:00:01", + sw_version="1.23.5", + hw_version="1.2.3", + manufacturer="ACME", ) details2 = AdapterDetails( - address="00:00:00:00:00:02", sw_version="1.23.5", hw_version="1.2.3" + address="00:00:00:00:00:02", + sw_version="1.23.5", + hw_version="1.2.3", + manufacturer="ACME", ) with patch( @@ -226,7 +238,10 @@ async def test_async_step_integration_discovery_during_onboarding_two_adapters( async def test_async_step_integration_discovery_during_onboarding(hass, macos_adapter): """Test setting up from integration discovery during onboarding.""" details = AdapterDetails( - address=DEFAULT_ADDRESS, sw_version="1.23.5", hw_version="1.2.3" + address=DEFAULT_ADDRESS, + sw_version="1.23.5", + hw_version="1.2.3", + manufacturer="ACME", ) with patch( @@ -252,7 +267,10 @@ async def test_async_step_integration_discovery_during_onboarding(hass, macos_ad async def test_async_step_integration_discovery_already_exists(hass): """Test setting up from integration discovery when an entry already exists.""" details = AdapterDetails( - address="00:00:00:00:00:01", sw_version="1.23.5", hw_version="1.2.3" + address="00:00:00:00:00:01", + sw_version="1.23.5", + hw_version="1.2.3", + manufacturer="ACME", ) entry = MockConfigEntry(domain=DOMAIN, unique_id="00:00:00:00:00:01") diff --git a/tests/components/bluetooth/test_diagnostics.py b/tests/components/bluetooth/test_diagnostics.py index 20ffddf3297..bfd39f74303 100644 --- a/tests/components/bluetooth/test_diagnostics.py +++ b/tests/components/bluetooth/test_diagnostics.py @@ -76,12 +76,20 @@ async def test_diagnostics( "hw_version": "usb:v1D6Bp0246d053F", "passive_scan": False, "sw_version": "homeassistant", + "manufacturer": "ACME", + "product": "Bluetooth Adapter 5.0", + "product_id": "aa01", + "vendor_id": "cc01", }, "hci1": { "address": "00:00:00:00:00:02", "hw_version": "usb:v1D6Bp0246d053F", "passive_scan": True, "sw_version": "homeassistant", + "manufacturer": "ACME", + "product": "Bluetooth Adapter 5.0", + "product_id": "aa01", + "vendor_id": "cc01", }, }, "dbus": { @@ -107,12 +115,20 @@ async def test_diagnostics( "hw_version": "usb:v1D6Bp0246d053F", "passive_scan": False, "sw_version": "homeassistant", + "manufacturer": "ACME", + "product": "Bluetooth Adapter 5.0", + "product_id": "aa01", + "vendor_id": "cc01", }, "hci1": { "address": "00:00:00:00:00:02", "hw_version": "usb:v1D6Bp0246d053F", "passive_scan": True, "sw_version": "homeassistant", + "manufacturer": "ACME", + "product": "Bluetooth Adapter 5.0", + "product_id": "aa01", + "vendor_id": "cc01", }, }, "advertisement_tracker": { @@ -249,6 +265,10 @@ async def test_diagnostics_macos( "address": "00:00:00:00:00:00", "passive_scan": False, "sw_version": ANY, + "manufacturer": "Apple", + "product": "Unknown MacOS Model", + "product_id": "Unknown", + "vendor_id": "Unknown", } }, "manager": { @@ -257,6 +277,10 @@ async def test_diagnostics_macos( "address": "00:00:00:00:00:00", "passive_scan": False, "sw_version": ANY, + "manufacturer": "Apple", + "product": "Unknown MacOS Model", + "product_id": "Unknown", + "vendor_id": "Unknown", } }, "advertisement_tracker": { diff --git a/tests/conftest.py b/tests/conftest.py index ca005625655..a508b8c32ef 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1050,6 +1050,10 @@ def mock_bluetooth_adapters(): "hw_version": "usb:v1D6Bp0246d053F", "passive_scan": False, "sw_version": "homeassistant", + "manufacturer": "ACME", + "product": "Bluetooth Adapter 5.0", + "product_id": "aa01", + "vendor_id": "cc01", }, }, ):