mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix Panel_IFrame - FTP URL not allowed in 0.63 (#12295)
This commit is contained in:
parent
2edebfee0a
commit
64c5d26a84
@ -23,13 +23,14 @@ CONF_RELATIVE_URL_REGEX = r'\A/'
|
|||||||
CONFIG_SCHEMA = vol.Schema({
|
CONFIG_SCHEMA = vol.Schema({
|
||||||
DOMAIN: vol.Schema({
|
DOMAIN: vol.Schema({
|
||||||
cv.slug: {
|
cv.slug: {
|
||||||
|
# pylint: disable=no-value-for-parameter
|
||||||
vol.Optional(CONF_TITLE): cv.string,
|
vol.Optional(CONF_TITLE): cv.string,
|
||||||
vol.Optional(CONF_ICON): cv.icon,
|
vol.Optional(CONF_ICON): cv.icon,
|
||||||
vol.Required(CONF_URL): vol.Any(
|
vol.Required(CONF_URL): vol.Any(
|
||||||
vol.Match(
|
vol.Match(
|
||||||
CONF_RELATIVE_URL_REGEX,
|
CONF_RELATIVE_URL_REGEX,
|
||||||
msg=CONF_RELATIVE_URL_ERROR_MSG),
|
msg=CONF_RELATIVE_URL_ERROR_MSG),
|
||||||
cv.url),
|
vol.Url()),
|
||||||
}})}, extra=vol.ALLOW_EXTRA)
|
}})}, extra=vol.ALLOW_EXTRA)
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,6 +55,11 @@ class TestPanelIframe(unittest.TestCase):
|
|||||||
'title': 'Api',
|
'title': 'Api',
|
||||||
'url': '/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': '/frontend_es5/panels/ha-panel-iframe-md5md5.html',
|
||||||
'url_path': 'api',
|
'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…
x
Reference in New Issue
Block a user