from .const import CONF_SOURCE as CONF_SOURCE, CONF_SOURCE_CONFIG_ENTRY_ID as CONF_SOURCE_CONFIG_ENTRY_ID, CONF_SOURCE_DEVICE_ID as CONF_SOURCE_DEVICE_ID, CONF_SOURCE_DOMAIN as CONF_SOURCE_DOMAIN, CONF_SOURCE_MODEL as CONF_SOURCE_MODEL, DOMAIN as DOMAIN
from .match import ADDRESS as ADDRESS, BluetoothCallbackMatcher as BluetoothCallbackMatcher, BluetoothCallbackMatcherIndex as BluetoothCallbackMatcherIndex, BluetoothCallbackMatcherWithCallback as BluetoothCallbackMatcherWithCallback, CALLBACK as CALLBACK, CONNECTABLE as CONNECTABLE, IntegrationMatcher as IntegrationMatcher, ble_device_matches as ble_device_matches
from .models import BluetoothCallback as BluetoothCallback, BluetoothChange as BluetoothChange, BluetoothServiceInfoBleak as BluetoothServiceInfoBleak
from .storage import BluetoothStorage as BluetoothStorage
from .util import async_load_history_from_system as async_load_history_from_system
from _typeshed import Incomplete
from bleak_retry_connector import BleakSlotManager as BleakSlotManager
from bluetooth_adapters import BluetoothAdapters as BluetoothAdapters
from collections.abc import Callable as Callable
from habluetooth import BaseHaScanner as BaseHaScanner, BluetoothManager, HaScanner
from homeassistant import config_entries as config_entries
from homeassistant.const import EVENT_HOMEASSISTANT_STOP as EVENT_HOMEASSISTANT_STOP, EVENT_LOGGING_CHANGED as EVENT_LOGGING_CHANGED
from homeassistant.core import CALLBACK_TYPE as CALLBACK_TYPE, Event as Event, HomeAssistant as HomeAssistant, callback as hass_callback
from homeassistant.helpers import discovery_flow as discovery_flow
from homeassistant.helpers.dispatcher import async_dispatcher_connect as async_dispatcher_connect
from homeassistant.util.package import is_docker_env as is_docker_env

_LOGGER: Incomplete

class HomeAssistantBluetoothManager(BluetoothManager):
    __slots__: Incomplete
    hass: Incomplete
    storage: Incomplete
    _integration_matcher: Incomplete
    _callback_index: Incomplete
    _cancel_logging_listener: CALLBACK_TYPE | None
    def __init__(self, hass: HomeAssistant, integration_matcher: IntegrationMatcher, bluetooth_adapters: BluetoothAdapters, storage: BluetoothStorage, slot_manager: BleakSlotManager) -> None: ...
    _debug: Incomplete
    @hass_callback
    def _async_logging_changed(self, event: Event | None = None) -> None: ...
    def _async_trigger_matching_discovery(self, service_info: BluetoothServiceInfoBleak) -> None: ...
    @hass_callback
    def async_rediscover_address(self, address: str) -> None: ...
    @hass_callback
    def async_clear_address_from_match_history(self, address: str) -> None: ...
    def _discover_service_info(self, service_info: BluetoothServiceInfoBleak) -> None: ...
    def _address_disappeared(self, address: str) -> None: ...
    async def async_setup(self) -> None: ...
    def async_register_callback(self, callback: BluetoothCallback, matcher: BluetoothCallbackMatcher | None) -> Callable[[], None]: ...
    @hass_callback
    def async_stop(self, event: Event | None = None) -> None: ...
    def _async_save_scanner_histories(self) -> None: ...
    def _async_save_scanner_history(self, scanner: BaseHaScanner) -> None: ...
    def _async_unregister_scanner(self, scanner: BaseHaScanner, unregister: CALLBACK_TYPE) -> None: ...
    @hass_callback
    def async_register_hass_scanner(self, scanner: BaseHaScanner, connection_slots: int | None = None, source_domain: str | None = None, source_model: str | None = None, source_config_entry_id: str | None = None, source_device_id: str | None = None) -> CALLBACK_TYPE: ...
    def async_register_scanner(self, scanner: BaseHaScanner, connection_slots: int | None = None) -> CALLBACK_TYPE: ...
    @hass_callback
    def async_remove_scanner(self, source: str) -> None: ...
    @hass_callback
    def _handle_config_entry_removed(self, entry: config_entries.ConfigEntry) -> None: ...
    def on_scanner_start(self, scanner: BaseHaScanner) -> None: ...
    @hass_callback
    def async_check_scanning_mode(self, scanner: HaScanner) -> None: ...
    @hass_callback
    def async_check_degraded_mode(self, scanner: HaScanner) -> None: ...
