Fix Panel_IFrame - FTP URL not allowed in 0.63 (#12295)
parent
2edebfee0a
commit
64c5d26a84
|
@ -23,13 +23,14 @@ CONF_RELATIVE_URL_REGEX = r'\A/'
|
|||
CONFIG_SCHEMA = vol.Schema({
|
||||
DOMAIN: vol.Schema({
|
||||
cv.slug: {
|
||||
# pylint: disable=no-value-for-parameter
|
||||
vol.Optional(CONF_TITLE): cv.string,
|
||||
vol.Optional(CONF_ICON): cv.icon,
|
||||
vol.Required(CONF_URL): vol.Any(
|
||||
vol.Match(
|
||||
CONF_RELATIVE_URL_REGEX,
|
||||
msg=CONF_RELATIVE_URL_ERROR_MSG),
|
||||
cv.url),
|
||||
vol.Url()),
|
||||
}})}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
|
|
|
@ -55,6 +55,11 @@ class TestPanelIframe(unittest.TestCase):
|
|||
'title': 'Api',
|
||||
'url': '/api',
|
||||
},
|
||||
'ftp': {
|
||||
'icon': 'mdi:weather',
|
||||
'title': 'FTP',
|
||||
'url': 'ftp://some/ftp',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -86,3 +91,12 @@ class TestPanelIframe(unittest.TestCase):
|
|||
'url': '/frontend_es5/panels/ha-panel-iframe-md5md5.html',
|
||||
'url_path': 'api',
|
||||
}
|
||||
|
||||
assert panels.get('ftp').to_response(self.hass, None) == {
|
||||
'component_name': 'iframe',
|
||||
'config': {'url': 'ftp://some/ftp'},
|
||||
'icon': 'mdi:weather',
|
||||
'title': 'FTP',
|
||||
'url': '/frontend_es5/panels/ha-panel-iframe-md5md5.html',
|
||||
'url_path': 'ftp',
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue