From db7f6a328feaba2231d9f49f418a2e438cb72c33 Mon Sep 17 00:00:00 2001 From: Open Home Automation Date: Sun, 4 Sep 2016 01:47:11 +0200 Subject: [PATCH] Bugfix: ctach Runtime errors (#3153) "RuntimeError: Disable scan failed" has been seen in a live installation --- .../components/device_tracker/bluetooth_le_tracker.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/device_tracker/bluetooth_le_tracker.py b/homeassistant/components/device_tracker/bluetooth_le_tracker.py index ce8a535ff57e3e..a9b95cf6a6b794 100644 --- a/homeassistant/components/device_tracker/bluetooth_le_tracker.py +++ b/homeassistant/components/device_tracker/bluetooth_le_tracker.py @@ -58,10 +58,13 @@ def see_device(address, name, new_device=False): def discover_ble_devices(): """Discover Bluetooth LE devices.""" _LOGGER.debug("Discovering Bluetooth LE devices") - service = DiscoveryService() - devices = service.discover(duration) - _LOGGER.debug("Bluetooth LE devices discovered = %s", devices) - + try: + service = DiscoveryService() + devices = service.discover(duration) + _LOGGER.debug("Bluetooth LE devices discovered = %s", devices) + except RuntimeError as error: + _LOGGER.error("Error during Bluetooth LE scan: %s", error) + devices = [] return devices yaml_path = hass.config.path(YAML_DEVICES)