Axis - Improve discovery title by adding placeholder support (#27663)
* Improve discovery title by adding placeholder support
This commit is contained in:
1 parent
0607a30612
commit
6ffc520b1c
4 files changed
+11
No files matched your search
@@ -191,6 +191,12 @@ class AxisFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
load_json, self.hass.config.path(CONFIG_FILE)
|
||||
)
|
||||
|
||||
# pylint: disable=no-member # https://github.com/PyCQA/pylint/issues/3167
|
||||
self.context["title_placeholders"] = {
|
||||
"name": discovery_info["hostname"][:-7],
|
||||
"host": discovery_info[CONF_HOST],
|
||||
}
|
||||
|
||||
if serialnumber not in config_file:
|
||||
self.discovery_schema = {
|
||||
vol.Required(CONF_HOST, default=discovery_info[CONF_HOST]): str,
|
||||
@@ -198,6 +204,7 @@ class AxisFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
vol.Required(CONF_PASSWORD): str,
|
||||
vol.Required(CONF_PORT, default=discovery_info[CONF_PORT]): int,
|
||||
}
|
||||
|
||||
return await self.async_step_user()
|
||||
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user