Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/skykettle-ha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'custom_components/skykettle/config_flow.py')
-rw-r--r--custom_components/skykettle/config_flow.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/custom_components/skykettle/config_flow.py b/custom_components/skykettle/config_flow.py
index 93c45cc..3a5cdc9 100644
--- a/custom_components/skykettle/config_flow.py
+++ b/custom_components/skykettle/config_flow.py
@@ -70,9 +70,13 @@ class SkyKettleConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
return await self.async_step_connect()
try:
- scanner = bluetooth.async_get_scanner(self.hass)
- for device in scanner.discovered_devices:
- _LOGGER.debug(f"Device found: {device.address} - {device.name}")
+ try:
+ scanner = bluetooth.async_get_scanner(self.hass)
+ for device in scanner.discovered_devices:
+ _LOGGER.debug(f"Device found: {device.address} - {device.name}")
+ except:
+ _LOGGER.error("Bluetooth integration not working")
+ return self.async_abort(reason='no_bluetooth')
devices_filtered = [device for device in scanner.discovered_devices if device.name and (device.name.startswith("RK-") or device.name.startswith("RFS-"))]
if len(devices_filtered) == 0:
return self.async_abort(reason='kettle_not_found')