Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Weblinks - FTP URL not allowed in 0.63 #12294

Merged
merged 1 commit into from
Feb 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion homeassistant/components/weblink.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
DOMAIN = 'weblink'

ENTITIES_SCHEMA = vol.Schema({
# pylint: disable=no-value-for-parameter
vol.Required(CONF_URL): vol.Any(
vol.Match(CONF_RELATIVE_URL_REGEX, msg=CONF_RELATIVE_URL_ERROR_MSG),
cv.url),
vol.Url()),
vol.Required(CONF_NAME): cv.string,
vol.Optional(CONF_ICON): cv.icon,
})
Expand Down
13 changes: 13 additions & 0 deletions tests/components/test_weblink.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ def test_good_config_path_directory(self):
}
}))

def test_good_config_ftp_link(self):
"""Test if new entity is created."""
self.assertTrue(setup_component(self.hass, 'weblink', {
'weblink': {
'entities': [
{
weblink.CONF_NAME: 'My FTP URL',
weblink.CONF_URL: 'ftp://somehost/'
},
],
}
}))

def test_entities_get_created(self):
"""Test if new entity is created."""
self.assertTrue(setup_component(self.hass, weblink.DOMAIN, {
Expand Down