mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Add translations for shelly ble scanner options in option flow (#86218)
* Add translations for shelly ble scanner options * Remove redundant labels * isort
This commit is contained in:
parent
bf41a971a2
commit
66f12d7dab
@ -21,11 +21,7 @@ from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.data_entry_flow import FlowResult
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.helpers.selector import (
|
||||
SelectOptionDict,
|
||||
SelectSelector,
|
||||
SelectSelectorConfig,
|
||||
)
|
||||
from homeassistant.helpers.selector import SelectSelector, SelectSelectorConfig
|
||||
|
||||
from .const import (
|
||||
BLE_MIN_VERSION,
|
||||
@ -53,9 +49,9 @@ HOST_SCHEMA: Final = vol.Schema({vol.Required(CONF_HOST): str})
|
||||
|
||||
|
||||
BLE_SCANNER_OPTIONS = [
|
||||
SelectOptionDict(value=BLEScannerMode.DISABLED, label="Disabled"),
|
||||
SelectOptionDict(value=BLEScannerMode.ACTIVE, label="Active"),
|
||||
SelectOptionDict(value=BLEScannerMode.PASSIVE, label="Passive"),
|
||||
BLEScannerMode.DISABLED,
|
||||
BLEScannerMode.ACTIVE,
|
||||
BLEScannerMode.PASSIVE,
|
||||
]
|
||||
|
||||
INTERNAL_WIFI_AP_IP = "192.168.33.1"
|
||||
@ -403,7 +399,10 @@ class OptionsFlowHandler(OptionsFlow):
|
||||
CONF_BLE_SCANNER_MODE, BLEScannerMode.DISABLED
|
||||
),
|
||||
): SelectSelector(
|
||||
SelectSelectorConfig(options=BLE_SCANNER_OPTIONS),
|
||||
SelectSelectorConfig(
|
||||
options=BLE_SCANNER_OPTIONS,
|
||||
translation_key=CONF_BLE_SCANNER_MODE,
|
||||
),
|
||||
),
|
||||
}
|
||||
),
|
||||
|
@ -71,5 +71,14 @@
|
||||
"abort": {
|
||||
"ble_unsupported": "Bluetooth support requires firmware version {ble_min_version} or newer."
|
||||
}
|
||||
},
|
||||
"selector": {
|
||||
"ble_scanner_mode": {
|
||||
"options": {
|
||||
"disabled": "Disabled",
|
||||
"active": "Active",
|
||||
"passive": "Passive"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,5 +71,14 @@
|
||||
"description": "Bluetooth scanning can be active or passive. With active, the Shelly requests data from nearby devices; with passive, the Shelly receives unsolicited data from nearby devices."
|
||||
}
|
||||
}
|
||||
},
|
||||
"selector": {
|
||||
"ble_scanner_mode": {
|
||||
"options": {
|
||||
"disabled": "Disabled",
|
||||
"active": "Active",
|
||||
"passive": "Passive"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user