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:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-08-16 13:23:46 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-08-16 13:23:46 +0300
commit408f9144cee5c946c669ad908d5c9e80294b6b49 (patch)
tree7939a1077b808551c64b5a5a744c0ef0a29400a2
parent0b4166ce68cab806cfc2eac61c73083774cfdb73 (diff)
Error messages in config flow
-rw-r--r--custom_components/skykettle/config_flow.py10
-rw-r--r--custom_components/skykettle/translations/en.json14
-rw-r--r--custom_components/skykettle/translations/ru.json14
3 files changed, 11 insertions, 27 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')
diff --git a/custom_components/skykettle/translations/en.json b/custom_components/skykettle/translations/en.json
index 284efdb..3092fa2 100644
--- a/custom_components/skykettle/translations/en.json
+++ b/custom_components/skykettle/translations/en.json
@@ -2,20 +2,17 @@
"title": "SkyKettle",
"config": {
"abort": {
+ "no_bluetooth": "Seems like the Bluetooth integration is not installed or not working. This integration depends on it.",
"kettle_not_found": "Can't find any supported kettle. Please make sure that your kettle is in the list of supported devices and it's on the stand.",
"already_configured": "Integration for this kettle is already configured.",
"unknown_model": "Your kettle model is not yet supported by this integration. But you can help add support for it! Contact the author via the 'issues' section on GitHub ('report an issue' in HACS).",
"unknown": "Unknown error, please check logs."
},
"error": {
- "cant_connect": "Can't connect to the kettle. Please make sure that it's on the stand, hatttool is granted with privileges (check instrucrions) and official application is not connected to the kettle.",
+ "cant_connect": "Can't connect to the kettle. Please make sure that it's on the stand.",
"cant_auth": "Connected to the kettle but pairing failed. Please try again."
},
"step": {
- "select_adapter": {
- "title": "Bluetooth Adapter",
- "description": "Select the Bluetooth adapter which will be used to connect to the kettle."
- },
"scan_message": {
"title": "Automatic discovery of the kettle",
"description": "Make sure that the Kettle is on the stand and it's plugged into the outlet then proceed."
@@ -27,13 +24,6 @@
"mac": "MAC address of the kettle"
}
},
- "manual_mac": {
- "title": "MAC Address",
- "description": "Enter MAC address of your kettle.",
- "data": {
- "mac": "MAC address of the kettle"
- }
- },
"connect": {
"title": "First connect",
"description": "Please put your kettle into pairing mode (check the user manual, usually need to hold some button for 10 seconds) before next step."
diff --git a/custom_components/skykettle/translations/ru.json b/custom_components/skykettle/translations/ru.json
index 9732312..57b8038 100644
--- a/custom_components/skykettle/translations/ru.json
+++ b/custom_components/skykettle/translations/ru.json
@@ -2,20 +2,17 @@
"title": "SkyKettle",
"config": {
"abort": {
+ "no_bluetooth": "Похоже, что интеграция 'Bluetooth' не установлена или не работает. Эта интеграция зависит от неё.",
"kettle_not_found": "Не могу найти чайник. Пожалуйста, убедитесь, что модель вашего чайника есть в списке поддерживаемых, и что он стоит на подставке.",
"already_configured": "Для этого чайника интеграция уже настроена.",
"unknown_model": "Модель вашего чайника пока что не поддерживается этой интеграцией. Но вы можете помочь добавить его поддержку! Свяжитесь с автором через раздел 'issues' на GitHub ('сообщить о проблеме' в HACS).",
"unknown": "Неизвестная ошибка, смотрите логи."
},
"error": {
- "cant_connect": "Не могу подключиться к чайнику. Пожалуйста, убедитесь, что он стоит на подставке, включен в розетку, утилите \"hatttool\" предоставлены права (смотрите инструкцию), и официальное приложение сейчас не подключено к чайнику.",
+ "cant_connect": "Не могу подключиться к чайнику. Пожалуйста, убедитесь, что он стоит на подставке, включен в розетку.",
"cant_auth": "Подключились к чайнику, но сопряжение не удалось. Попробуйте снова."
},
"step": {
- "select_adapter": {
- "title": "Bluetooth адаптер",
- "description": "Выберите Bluetooth адаптер, который будет использоваться для подключения к чайнику."
- },
"scan_message": {
"title": "Автоматическое обнаружение чайника",
"description": "Пожалуйста, убедитесь, что чайник стоит на подставке и включен в розетку."
@@ -27,13 +24,6 @@
"mac": "MAC адрес чайника"
}
},
- "manual_mac": {
- "title": "MAC адрес",
- "description": "Введите MAC-адрес вашего чайника.",
- "data": {
- "mac": "MAC адрес чайника"
- }
- },
"connect": {
"title": "Первое подключение",
"description": "Пожалуйста, убедитесь, что чайник в режиме сопряжения (смотрите инструкцию от чайника, обычно для этого надо зажать какую-то кнопку на 10 секунд)."