Update docstring and fix typos

This commit is contained in:
Fabian Affolter 2016-01-27 09:21:21 +01:00
parent 70d95cb6aa
commit cf7c06d307

View File

@ -1,6 +1,6 @@
""" """
homeassistant.components.sensor.template homeassistant.components.sensor.template
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows the creation of a sensor that breaks out state_attributes Allows the creation of a sensor that breaks out state_attributes
from other entities. from other entities.
@ -20,9 +20,7 @@ from homeassistant.util import template
from homeassistant.exceptions import TemplateError from homeassistant.exceptions import TemplateError
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
CONF_SENSORS = 'sensors' CONF_SENSORS = 'sensors'
STATE_ERROR = 'error' STATE_ERROR = 'error'
@ -32,7 +30,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
sensors = [] sensors = []
if config.get(CONF_SENSORS) is None: if config.get(CONF_SENSORS) is None:
_LOGGER.error("Missing configuration data for sensor platfoprm") _LOGGER.error("Missing configuration data for sensor platform")
return False return False
for device, device_config in config[CONF_SENSORS].items(): for device, device_config in config[CONF_SENSORS].items():
@ -54,7 +52,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
state_template) state_template)
) )
if sensors is None: if sensors is None:
_LOGGER.error("No sensors added.") _LOGGER.error("No sensors added")
return False return False
add_devices(sensors) add_devices(sensors)
return True return True