mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Remove get_device call in led-ble (#83880)
This commit is contained in:
parent
1ee2959e4e
commit
938475d988
@ -6,7 +6,7 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
from led_ble import BLEAK_EXCEPTIONS, LEDBLE, get_device
|
from led_ble import BLEAK_EXCEPTIONS, LEDBLE
|
||||||
|
|
||||||
from homeassistant.components import bluetooth
|
from homeassistant.components import bluetooth
|
||||||
from homeassistant.components.bluetooth.match import ADDRESS, BluetoothCallbackMatcher
|
from homeassistant.components.bluetooth.match import ADDRESS, BluetoothCallbackMatcher
|
||||||
@ -27,9 +27,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Set up LED BLE from a config entry."""
|
"""Set up LED BLE from a config entry."""
|
||||||
address: str = entry.data[CONF_ADDRESS]
|
address: str = entry.data[CONF_ADDRESS]
|
||||||
ble_device = bluetooth.async_ble_device_from_address(
|
ble_device = bluetooth.async_ble_device_from_address(hass, address.upper(), True)
|
||||||
hass, address.upper(), True
|
|
||||||
) or await get_device(address)
|
|
||||||
if not ble_device:
|
if not ble_device:
|
||||||
raise ConfigEntryNotReady(
|
raise ConfigEntryNotReady(
|
||||||
f"Could not find LED BLE device with address {address}"
|
f"Could not find LED BLE device with address {address}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user