Remove unreachable template validation for imap config flow (#94862)
This commit is contained in:
parent
ce8217acf5
commit
8b6d2fc3ce
2 changed files with 1 additions and 9 deletions
|
@ -19,7 +19,6 @@ from homeassistant.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.data_entry_flow import AbortFlow, FlowResult
|
from homeassistant.data_entry_flow import AbortFlow, FlowResult
|
||||||
from homeassistant.exceptions import TemplateError
|
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
from homeassistant.helpers.selector import (
|
from homeassistant.helpers.selector import (
|
||||||
BooleanSelector,
|
BooleanSelector,
|
||||||
|
@ -29,7 +28,6 @@ from homeassistant.helpers.selector import (
|
||||||
TemplateSelector,
|
TemplateSelector,
|
||||||
TemplateSelectorConfig,
|
TemplateSelectorConfig,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.template import Template
|
|
||||||
from homeassistant.util.ssl import SSLCipherList
|
from homeassistant.util.ssl import SSLCipherList
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
|
@ -122,11 +120,6 @@ async def validate_input(
|
||||||
errors[CONF_CHARSET] = "invalid_charset"
|
errors[CONF_CHARSET] = "invalid_charset"
|
||||||
else:
|
else:
|
||||||
errors[CONF_SEARCH] = "invalid_search"
|
errors[CONF_SEARCH] = "invalid_search"
|
||||||
if template := user_input.get(CONF_CUSTOM_EVENT_DATA_TEMPLATE):
|
|
||||||
try:
|
|
||||||
Template(template, hass=hass).ensure_valid()
|
|
||||||
except TemplateError:
|
|
||||||
errors[CONF_CUSTOM_EVENT_DATA_TEMPLATE] = "invalid_template"
|
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,7 @@
|
||||||
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
||||||
"invalid_charset": "[%key:component::imap::config::error::invalid_charset%]",
|
"invalid_charset": "[%key:component::imap::config::error::invalid_charset%]",
|
||||||
"invalid_folder": "[%key:component::imap::config::error::invalid_folder%]",
|
"invalid_folder": "[%key:component::imap::config::error::invalid_folder%]",
|
||||||
"invalid_search": "[%key:component::imap::config::error::invalid_search%]",
|
"invalid_search": "[%key:component::imap::config::error::invalid_search%]"
|
||||||
"invalid_template": "Invalid template"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"selector": {
|
"selector": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue