mirror of
https://github.com/home-assistant/core.git
synced 2026-12-04 20:59:22 -04:00
Import names from their source modules in bluetooth (#187465)
This commit is contained in:
@@ -25,6 +25,7 @@ from bluetooth_adapters import (
|
||||
)
|
||||
from bluetooth_data_tools import monotonic_time_coarse as MONOTONIC_TIME
|
||||
from habluetooth import (
|
||||
FALLBACK_MAXIMUM_STALE_ADVERTISEMENT_SECONDS,
|
||||
BaseHaRemoteScanner,
|
||||
BaseHaScanner,
|
||||
BluetoothReachabilityIntent,
|
||||
@@ -89,7 +90,6 @@ from .const import (
|
||||
CONF_SOURCE_DOMAIN,
|
||||
CONF_SOURCE_MODEL,
|
||||
DOMAIN,
|
||||
FALLBACK_MAXIMUM_STALE_ADVERTISEMENT_SECONDS,
|
||||
LINUX_FIRMWARE_LOAD_FALLBACK_SECONDS,
|
||||
SOURCE_LOCAL,
|
||||
)
|
||||
|
||||
@@ -22,7 +22,7 @@ from homeassistant.config_entries import (
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
)
|
||||
from homeassistant.const import CONF_SOURCE
|
||||
from homeassistant.const import CONF_MODE, CONF_SOURCE
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.schema_config_entry_flow import (
|
||||
SchemaCommonFlowHandler,
|
||||
@@ -39,7 +39,6 @@ from homeassistant.helpers.typing import DiscoveryInfoType
|
||||
from .const import (
|
||||
CONF_ADAPTER,
|
||||
CONF_DETAILS,
|
||||
CONF_MODE,
|
||||
CONF_PASSIVE,
|
||||
CONF_SOURCE_CONFIG_ENTRY_ID,
|
||||
CONF_SOURCE_DEVICE_ID,
|
||||
|
||||
@@ -21,6 +21,7 @@ from habluetooth import (
|
||||
BluetoothScanningMode,
|
||||
HaScanner,
|
||||
)
|
||||
from home_assistant_bluetooth import BluetoothServiceInfoBleak
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.const import (
|
||||
@@ -55,12 +56,7 @@ from .match import (
|
||||
IntegrationMatcher,
|
||||
ble_device_matches,
|
||||
)
|
||||
from .models import (
|
||||
BluetoothCallback,
|
||||
BluetoothCallbackReplay,
|
||||
BluetoothChange,
|
||||
BluetoothServiceInfoBleak,
|
||||
)
|
||||
from .models import BluetoothCallback, BluetoothCallbackReplay, BluetoothChange
|
||||
from .storage import BluetoothStorage
|
||||
from .util import async_load_history_from_system
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@ from functools import lru_cache
|
||||
import re
|
||||
from typing import TYPE_CHECKING, Final, TypedDict
|
||||
|
||||
from home_assistant_bluetooth import BluetoothServiceInfoBleak
|
||||
from lru import LRU
|
||||
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.loader import BluetoothMatcher, BluetoothMatcherOptional
|
||||
|
||||
from .models import BluetoothCallback, BluetoothServiceInfoBleak
|
||||
from .models import BluetoothCallback
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from bleak.backends.scanner import AdvertisementData
|
||||
|
||||
@@ -29,9 +29,11 @@ from .update_coordinator import BasePassiveBluetoothCoordinator
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Callable
|
||||
|
||||
from home_assistant_bluetooth import BluetoothServiceInfoBleak
|
||||
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .models import BluetoothChange, BluetoothServiceInfoBleak
|
||||
from .models import BluetoothChange
|
||||
|
||||
STORAGE_KEY = "bluetooth.passive_update_processor"
|
||||
STORAGE_VERSION = 1
|
||||
|
||||
@@ -4,6 +4,7 @@ from abc import ABC, abstractmethod
|
||||
import logging
|
||||
|
||||
from habluetooth import BluetoothScanningMode
|
||||
from home_assistant_bluetooth import BluetoothServiceInfoBleak
|
||||
|
||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
||||
|
||||
@@ -14,7 +15,7 @@ from .api import (
|
||||
async_track_unavailable,
|
||||
)
|
||||
from .match import BluetoothCallbackMatcher
|
||||
from .models import BluetoothChange, BluetoothServiceInfoBleak
|
||||
from .models import BluetoothChange
|
||||
|
||||
|
||||
class BasePassiveBluetoothCoordinator(ABC):
|
||||
|
||||
@@ -14,12 +14,13 @@ from bluetooth_adapters import (
|
||||
)
|
||||
from bluetooth_data_tools import monotonic_time_coarse
|
||||
from habluetooth import BluetoothScanningMode, get_manager
|
||||
from home_assistant_bluetooth import BluetoothServiceInfoBleak
|
||||
|
||||
from homeassistant.const import CONF_MODE
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
|
||||
from .const import CONF_MODE, CONF_PASSIVE, DEFAULT_MODE
|
||||
from .models import BluetoothServiceInfoBleak
|
||||
from .const import CONF_PASSIVE, DEFAULT_MODE
|
||||
from .storage import BluetoothStorage
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
Reference in New Issue
Block a user