Add connections to Xiaomi BLE and BTHome device entry (#102773)

This commit is contained in:
Jan-Philipp Benecke 2023-10-25 12:15:58 +02:00 committed by GitHub
parent d2f8c527a5
commit 6fae50cb75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -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,

View File

@ -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,