Skip to content

Commit

Permalink
Merge branch 'pr/2251' into dev
Browse files Browse the repository at this point in the history
Conflicts:
	homeassistant/components/switch/template.py
balloob committed Jun 8, 2016
2 parents fb2fb5e + d1ed17e commit 271546d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions homeassistant/components/switch/template.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
ATTR_ENTITY_ID, MATCH_ALL)
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.entity import generate_entity_id
from homeassistant.helpers.script import call_from_config
from homeassistant.helpers.script import Script
from homeassistant.helpers import template
from homeassistant.helpers.event import track_state_change
from homeassistant.util import slugify
@@ -90,8 +90,8 @@ def __init__(self, hass, device_id, friendly_name, state_template,
hass=hass)
self._name = friendly_name
self._template = state_template
self._on_action = on_action
self._off_action = off_action
self._on_script = Script(hass, on_action)
self._off_script = Script(hass, off_action)
self._state = False

self.update()
@@ -125,11 +125,11 @@ def available(self):

def turn_on(self, **kwargs):
"""Fire the on action."""
call_from_config(self.hass, self._on_action, True)
self._on_script.run()

def turn_off(self, **kwargs):
"""Fire the off action."""
call_from_config(self.hass, self._off_action, True)
self._off_script.run()

def update(self):
"""Update the state from the template."""

0 comments on commit 271546d

Please sign in to comment.