diff --git a/homeassistant/components/govee_ble/manifest.json b/homeassistant/components/govee_ble/manifest.json index 68542afe01c6..e52280143109 100644 --- a/homeassistant/components/govee_ble/manifest.json +++ b/homeassistant/components/govee_ble/manifest.json @@ -68,6 +68,10 @@ "manufacturer_id": 6966, "service_uuid": "00008451-0000-1000-8000-00805f9b34fb" }, + { + "connectable": false, + "service_uuid": "00005550-0000-1000-8000-00805f9b34fb" + }, { "connectable": false, "manufacturer_id": 63391, diff --git a/homeassistant/generated/bluetooth.py b/homeassistant/generated/bluetooth.py index 387254decddf..87daf21f9bc5 100644 --- a/homeassistant/generated/bluetooth.py +++ b/homeassistant/generated/bluetooth.py @@ -256,6 +256,11 @@ BLUETOOTH: Final[list[dict[str, bool | str | int | list[int]]]] = [ "manufacturer_id": 6966, "service_uuid": "00008451-0000-1000-8000-00805f9b34fb", }, + { + "connectable": False, + "domain": "govee_ble", + "service_uuid": "00005550-0000-1000-8000-00805f9b34fb", + }, { "connectable": False, "domain": "govee_ble", diff --git a/tests/components/govee_ble/__init__.py b/tests/components/govee_ble/__init__.py index b494256e6ea3..73b9cfa563bd 100644 --- a/tests/components/govee_ble/__init__.py +++ b/tests/components/govee_ble/__init__.py @@ -24,6 +24,18 @@ GVH5075_SERVICE_INFO = BluetoothServiceInfo( source="local", ) +GVH5055_SERVICE_INFO = BluetoothServiceInfo( + name="", + address="C0:A3:C7:0A:5C:77", + rssi=-63, + manufacturer_data={ + 23562: b"\x77\x41\x00\x01\x01\xe4\x81\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" + }, + service_uuids=["00005550-0000-1000-8000-00805f9b34fb"], + service_data={}, + source="local", +) + GVH5184_SERVICE_INFO = BluetoothServiceInfo( name="GVH5184_XXXX", address="4125DDBA-2774-4851-9889-6AADDD4CAC3D", diff --git a/tests/components/govee_ble/test_config_flow.py b/tests/components/govee_ble/test_config_flow.py index a03aab0d222a..2b3a653e166b 100644 --- a/tests/components/govee_ble/test_config_flow.py +++ b/tests/components/govee_ble/test_config_flow.py @@ -7,9 +7,37 @@ from homeassistant.components.govee_ble.const import CONF_DEVICE_TYPE, DOMAIN from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType -from . import GVH5075_SERVICE_INFO, GVH5177_SERVICE_INFO, NOT_GOVEE_SERVICE_INFO +from . import ( + GVH5055_SERVICE_INFO, + GVH5075_SERVICE_INFO, + GVH5177_SERVICE_INFO, + NOT_GOVEE_SERVICE_INFO, +) from tests.common import MockConfigEntry +from tests.components.bluetooth import inject_bluetooth_service_info + + +async def test_async_step_bluetooth_h5055(hass: HomeAssistant) -> None: + """Test discovery via bluetooth with an H5055.""" + inject_bluetooth_service_info(hass, GVH5055_SERVICE_INFO) + await hass.async_block_till_done(wait_background_tasks=True) + + flows = hass.config_entries.flow.async_progress_by_handler(DOMAIN) + assert len(flows) == 1 + + result = flows[0] + assert result["step_id"] == "bluetooth_confirm" + + with patch( + "homeassistant.components.govee_ble.async_setup_entry", return_value=True + ): + result2 = await hass.config_entries.flow.async_configure( + result["flow_id"], user_input={} + ) + + assert result2["type"] is FlowResultType.CREATE_ENTRY + assert result2["data"] == {CONF_DEVICE_TYPE: "H5055"} async def test_async_step_bluetooth_valid_device(hass: HomeAssistant) -> None: