mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +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.config_entries import ConfigEntry
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
from homeassistant.core import HomeAssistant
|
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 (
|
from .const import (
|
||||||
BTHOME_BLE_EVENT,
|
BTHOME_BLE_EVENT,
|
||||||
@ -55,6 +59,7 @@ def process_service_info(
|
|||||||
sensor_device_info = update.devices[device_key.device_id]
|
sensor_device_info = update.devices[device_key.device_id]
|
||||||
device = device_registry.async_get_or_create(
|
device = device_registry.async_get_or_create(
|
||||||
config_entry_id=entry.entry_id,
|
config_entry_id=entry.entry_id,
|
||||||
|
connections={(CONNECTION_BLUETOOTH, address)},
|
||||||
identifiers={(BLUETOOTH_DOMAIN, address)},
|
identifiers={(BLUETOOTH_DOMAIN, address)},
|
||||||
manufacturer=sensor_device_info.manufacturer,
|
manufacturer=sensor_device_info.manufacturer,
|
||||||
model=sensor_device_info.model,
|
model=sensor_device_info.model,
|
||||||
|
@ -15,7 +15,11 @@ from homeassistant.components.bluetooth import (
|
|||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
from homeassistant.core import CoreState, HomeAssistant
|
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 (
|
from .const import (
|
||||||
CONF_DISCOVERED_EVENT_CLASSES,
|
CONF_DISCOVERED_EVENT_CLASSES,
|
||||||
@ -55,6 +59,7 @@ def process_service_info(
|
|||||||
sensor_device_info = update.devices[device_key.device_id]
|
sensor_device_info = update.devices[device_key.device_id]
|
||||||
device = device_registry.async_get_or_create(
|
device = device_registry.async_get_or_create(
|
||||||
config_entry_id=entry.entry_id,
|
config_entry_id=entry.entry_id,
|
||||||
|
connections={(CONNECTION_BLUETOOTH, address)},
|
||||||
identifiers={(BLUETOOTH_DOMAIN, address)},
|
identifiers={(BLUETOOTH_DOMAIN, address)},
|
||||||
manufacturer=sensor_device_info.manufacturer,
|
manufacturer=sensor_device_info.manufacturer,
|
||||||
model=sensor_device_info.model,
|
model=sensor_device_info.model,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user