mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Use core constants for bluetooth_tracker (#46041)
This commit is contained in:
parent
9a570d7c32
commit
6fdb12c09d
@ -20,6 +20,7 @@ from homeassistant.components.device_tracker.legacy import (
|
|||||||
YAML_DEVICES,
|
YAML_DEVICES,
|
||||||
async_load_config,
|
async_load_config,
|
||||||
)
|
)
|
||||||
|
from homeassistant.const import CONF_DEVICE_ID
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.event import async_track_time_interval
|
from homeassistant.helpers.event import async_track_time_interval
|
||||||
from homeassistant.helpers.typing import HomeAssistantType
|
from homeassistant.helpers.typing import HomeAssistantType
|
||||||
@ -32,8 +33,6 @@ BT_PREFIX = "BT_"
|
|||||||
|
|
||||||
CONF_REQUEST_RSSI = "request_rssi"
|
CONF_REQUEST_RSSI = "request_rssi"
|
||||||
|
|
||||||
CONF_DEVICE_ID = "device_id"
|
|
||||||
|
|
||||||
DEFAULT_DEVICE_ID = -1
|
DEFAULT_DEVICE_ID = -1
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
@ -131,7 +130,6 @@ async def async_setup_scanner(
|
|||||||
|
|
||||||
async def perform_bluetooth_update():
|
async def perform_bluetooth_update():
|
||||||
"""Discover Bluetooth devices and update status."""
|
"""Discover Bluetooth devices and update status."""
|
||||||
|
|
||||||
_LOGGER.debug("Performing Bluetooth devices discovery and update")
|
_LOGGER.debug("Performing Bluetooth devices discovery and update")
|
||||||
tasks = []
|
tasks = []
|
||||||
|
|
||||||
@ -164,7 +162,6 @@ async def async_setup_scanner(
|
|||||||
|
|
||||||
async def update_bluetooth(now=None):
|
async def update_bluetooth(now=None):
|
||||||
"""Lookup Bluetooth devices and update status."""
|
"""Lookup Bluetooth devices and update status."""
|
||||||
|
|
||||||
# If an update is in progress, we don't do anything
|
# If an update is in progress, we don't do anything
|
||||||
if update_bluetooth_lock.locked():
|
if update_bluetooth_lock.locked():
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
@ -178,7 +175,6 @@ async def async_setup_scanner(
|
|||||||
|
|
||||||
async def handle_manual_update_bluetooth(call):
|
async def handle_manual_update_bluetooth(call):
|
||||||
"""Update bluetooth devices on demand."""
|
"""Update bluetooth devices on demand."""
|
||||||
|
|
||||||
await update_bluetooth()
|
await update_bluetooth()
|
||||||
|
|
||||||
hass.async_create_task(update_bluetooth())
|
hass.async_create_task(update_bluetooth())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user