Update docstrings (#7361)

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update tomato.py

* Update isy994.py

* Lint + fix tests

* Lint
This commit is contained in:
Fabian Affolter
2017-04-30 07:04:49 +02:00
committed by Paulus Schoutsen
parent e22e70a01a
commit 3ee4d1060f
264 changed files with 1686 additions and 1768 deletions

View File

@@ -26,7 +26,7 @@ CONFIG_SCHEMA = vol.Schema({
def setup(hass, config):
"""Setup the shell_command component."""
"""Set up the shell_command component."""
conf = config.get(DOMAIN, {})
cache = {}
@@ -51,16 +51,16 @@ def setup(hass, config):
try:
rendered_args = args_compiled.render(call.data)
except TemplateError as ex:
_LOGGER.exception('Error rendering command template: %s', ex)
_LOGGER.exception("Error rendering command template: %s", ex)
return
else:
rendered_args = None
if rendered_args == args:
# no template used. default behavior
# No template used. default behavior
shell = True
else:
# template used. Break into list and use shell=False for security
# Template used. Break into list and use shell=False for security
cmd = [prog] + shlex.split(rendered_args)
shell = False
@@ -69,7 +69,7 @@ def setup(hass, config):
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
except subprocess.SubprocessError:
_LOGGER.exception('Error running command: %s', cmd)
_LOGGER.exception("Error running command: %s", cmd)
for name in conf.keys():
hass.services.register(DOMAIN, name, service_handler)