hass-core/homeassistant/components/bluetooth/usage.py
J. Nick Koston a697672944
Add bluetooth integration (#74653)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-07-08 18:55:31 -05:00

13 lines
466 B
Python

"""bluetooth usage utility to handle multiple instances."""
from __future__ import annotations
import bleak
from . import models
from .models import HaBleakScanner, HaBleakScannerWrapper
def install_multiple_bleak_catcher(hass_bleak_scanner: HaBleakScanner) -> None:
"""Wrap the bleak classes to return the shared instance if multiple instances are detected."""
models.HA_BLEAK_SCANNER = hass_bleak_scanner
bleak.BleakScanner = HaBleakScannerWrapper