mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 15:31:52 -05:00
Fix Govee H5055 Bluetooth discovery (#180443)
This commit is contained in:
@@ -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,
|
||||
|
||||
Generated
+5
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user