mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Add connections to Xiaomi BLE and BTHome device entry (#102773)
This commit is contained in:
parent
d2f8c527a5
commit
6fae50cb75
@ -14,7 +14,11 @@ from homeassistant.components.bluetooth import (
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.device_registry import DeviceRegistry, async_get
|
||||
from homeassistant.helpers.device_registry import (
|
||||
CONNECTION_BLUETOOTH,
|
||||
DeviceRegistry,
|
||||
async_get,
|
||||
)
|
||||
|
||||
from .const import (
|
||||
BTHOME_BLE_EVENT,
|
||||
@ -55,6 +59,7 @@ def process_service_info(
|
||||
sensor_device_info = update.devices[device_key.device_id]
|
||||
device = device_registry.async_get_or_create(
|
||||
config_entry_id=entry.entry_id,
|
||||
connections={(CONNECTION_BLUETOOTH, address)},
|
||||
identifiers={(BLUETOOTH_DOMAIN, address)},
|
||||
manufacturer=sensor_device_info.manufacturer,
|
||||
model=sensor_device_info.model,
|
||||
|
@ -15,7 +15,11 @@ from homeassistant.components.bluetooth import (
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import CoreState, HomeAssistant
|
||||
from homeassistant.helpers.device_registry import DeviceRegistry, async_get
|
||||
from homeassistant.helpers.device_registry import (
|
||||
CONNECTION_BLUETOOTH,
|
||||
DeviceRegistry,
|
||||
async_get,
|
||||
)
|
||||
|
||||
from .const import (
|
||||
CONF_DISCOVERED_EVENT_CLASSES,
|
||||
@ -55,6 +59,7 @@ def process_service_info(
|
||||
sensor_device_info = update.devices[device_key.device_id]
|
||||
device = device_registry.async_get_or_create(
|
||||
config_entry_id=entry.entry_id,
|
||||
connections={(CONNECTION_BLUETOOTH, address)},
|
||||
identifiers={(BLUETOOTH_DOMAIN, address)},
|
||||
manufacturer=sensor_device_info.manufacturer,
|
||||
model=sensor_device_info.model,
|
||||
|
Loading…
x
Reference in New Issue
Block a user