mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fix linting errors
This commit is contained in:
parent
925a623445
commit
38c50c830f
@ -13,7 +13,8 @@ ATTR_URL = 'url'
|
||||
ATTR_URL_DEFAULT = 'https://www.google.com'
|
||||
|
||||
SERVICE_BROWSE_URL_SCHEMA = vol.Schema({
|
||||
vol.Required(ATTR_URL, default=ATTR_URL_DEFAULT): vol.Url,
|
||||
# pylint: disable=no-value-for-parameter
|
||||
vol.Required(ATTR_URL, default=ATTR_URL_DEFAULT): vol.Url(),
|
||||
})
|
||||
|
||||
|
||||
|
@ -24,7 +24,8 @@ ATTR_URL = "url"
|
||||
ATTR_SUBDIR = "subdir"
|
||||
|
||||
SERVICE_DOWNLOAD_FILE_SCHEMA = vol.Schema({
|
||||
vol.Required(ATTR_URL): vol.Url,
|
||||
# pylint: disable=no-value-for-parameter
|
||||
vol.Required(ATTR_URL): vol.Url(),
|
||||
vol.Optional(ATTR_SUBDIR): cv.string,
|
||||
})
|
||||
|
||||
|
@ -19,7 +19,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
def register_built_in_panel(hass, component_name, title=None, icon=None,
|
||||
url_name=None, config=None):
|
||||
"""Register a built-in panel."""
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
path = 'panels/ha-panel-{}.html'.format(component_name)
|
||||
|
||||
register_panel(hass, component_name, os.path.join(STATIC_PATH, path),
|
||||
@ -40,6 +40,7 @@ def register_panel(hass, component_name, path, md5, title=None, icon=None,
|
||||
|
||||
Warning: this API will probably change. Use at own risk.
|
||||
"""
|
||||
# pylint: disable=too-many-arguments
|
||||
if url_name is None:
|
||||
url_name = component_name
|
||||
|
||||
@ -72,8 +73,6 @@ def register_panel(hass, component_name, path, md5, title=None, icon=None,
|
||||
|
||||
PANELS[url_name] = data
|
||||
|
||||
# TODO register /<component_name> to index view.
|
||||
|
||||
|
||||
def setup(hass, config):
|
||||
"""Setup serving the frontend."""
|
||||
|
@ -1,3 +1,4 @@
|
||||
"""Add an iframe panel to Home Assistant."""
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
@ -15,6 +16,7 @@ CONFIG_SCHEMA = vol.Schema({
|
||||
cv.slug: {
|
||||
vol.Optional(CONF_TITLE): cv.string,
|
||||
vol.Optional(CONF_ICON): cv.icon,
|
||||
# pylint: disable=no-value-for-parameter
|
||||
vol.Required(CONF_URL): vol.Url(),
|
||||
}})}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
@ -39,7 +39,8 @@ CONFIG_SCHEMA = vol.Schema({
|
||||
DOMAIN: vol.Schema({
|
||||
vol.Optional(CONF_PURGE_DAYS): vol.All(vol.Coerce(int),
|
||||
vol.Range(min=1)),
|
||||
vol.Optional(CONF_DB_URL): vol.Url(''),
|
||||
# pylint: disable=no-value-for-parameter
|
||||
vol.Optional(CONF_DB_URL): vol.Url(),
|
||||
})
|
||||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""Generate a file with all md5 hashes of the assets."""
|
||||
from collections import OrderedDict
|
||||
import glob
|
||||
import hashlib
|
||||
|
@ -1,5 +1,4 @@
|
||||
"""The tests for the panel_iframe component."""
|
||||
from collections import defaultdict
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
@ -15,6 +14,7 @@ class TestPanelIframe(unittest.TestCase):
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
frontend.PANELS = {}
|
||||
|
||||
def teardown_method(self, method):
|
||||
"""Stop everything that was started."""
|
||||
@ -23,7 +23,6 @@ class TestPanelIframe(unittest.TestCase):
|
||||
|
||||
def test_wrong_config(self):
|
||||
"""Test setup with wrong configuration."""
|
||||
|
||||
to_try = [
|
||||
{'invalid space': {
|
||||
'url': 'https://home-assistant.io'}},
|
||||
|
Loading…
x
Reference in New Issue
Block a user