Update docstrings.

This commit is contained in:
pavoni 2016-02-03 23:23:19 +00:00
parent 6e6c3c5cd5
commit b20d3f8b3a

View File

@ -135,9 +135,11 @@ class SwitchTemplate(SwitchDevice):
return False return False
def turn_on(self, **kwargs): def turn_on(self, **kwargs):
""" Fires the on action. """
call_from_config(self.hass, self._on_action, True) call_from_config(self.hass, self._on_action, True)
def turn_off(self, **kwargs): def turn_off(self, **kwargs):
""" Fires the off action. """
call_from_config(self.hass, self._off_action, True) call_from_config(self.hass, self._off_action, True)
@property @property
@ -147,7 +149,7 @@ class SwitchTemplate(SwitchDevice):
@property @property
def is_off(self): def is_off(self):
""" True if device is on. """ """ True if device is off. """
return self._state == STATE_FALSE or self._state == STATE_OFF return self._state == STATE_FALSE or self._state == STATE_OFF
@property @property
@ -160,6 +162,7 @@ class SwitchTemplate(SwitchDevice):
return self._state return self._state
def update(self): def update(self):
""" Updates the state from the template. """
try: try:
self._state = template.render(self.hass, self._template) self._state = template.render(self.hass, self._template)
except TemplateError as ex: except TemplateError as ex: