Service/Script cleanup

This commit is contained in:
Paulus Schoutsen 2016-04-23 07:11:21 +02:00
parent 533799656e
commit 14bd630c1d
4 changed files with 15 additions and 45 deletions

View file

@ -76,12 +76,12 @@ class Script():
self._change_listener()
return
elif service.validate_service_call(action) is None:
self._call_service(action, variables)
elif CONF_EVENT in action:
self._fire_event(action)
else:
self._call_service(action, variables)
self._cur = -1
self.last_action = None
if self._change_listener:
@ -102,7 +102,8 @@ class Script():
"""Call the service specified in the action."""
self.last_action = action.get(CONF_ALIAS, 'call service')
self._log("Executing step %s", self.last_action)
service.call_from_config(self.hass, action, True, variables)
service.call_from_config(self.hass, action, True, variables,
validate_config=False)
def _fire_event(self, action):
"""Fire an event."""