mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
script: Fix log output (#1918)
Signed-off-by: Gwendal Grignou <gwendal@gmail.com>
This commit is contained in:
parent
157036c1d2
commit
31e019e88a
@ -105,14 +105,14 @@ class Script():
|
|||||||
def _call_service(self, action, variables):
|
def _call_service(self, action, variables):
|
||||||
"""Call the service specified in the action."""
|
"""Call the service specified in the action."""
|
||||||
self.last_action = action.get(CONF_ALIAS, 'call service')
|
self.last_action = action.get(CONF_ALIAS, 'call service')
|
||||||
self._log("Executing step %s", self.last_action)
|
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)
|
validate_config=False)
|
||||||
|
|
||||||
def _fire_event(self, action):
|
def _fire_event(self, action):
|
||||||
"""Fire an event."""
|
"""Fire an event."""
|
||||||
self.last_action = action.get(CONF_ALIAS, action[CONF_EVENT])
|
self.last_action = action.get(CONF_ALIAS, action[CONF_EVENT])
|
||||||
self._log("Executing step %s", self.last_action)
|
self._log("Executing step %s" % self.last_action)
|
||||||
self.hass.bus.fire(action[CONF_EVENT], action.get(CONF_EVENT_DATA))
|
self.hass.bus.fire(action[CONF_EVENT], action.get(CONF_EVENT_DATA))
|
||||||
|
|
||||||
def _check_condition(self, action, variables):
|
def _check_condition(self, action, variables):
|
||||||
@ -129,9 +129,9 @@ class Script():
|
|||||||
self._delay_listener)
|
self._delay_listener)
|
||||||
self._delay_listener = None
|
self._delay_listener = None
|
||||||
|
|
||||||
def _log(self, msg, *substitutes):
|
def _log(self, msg):
|
||||||
"""Logger helper."""
|
"""Logger helper."""
|
||||||
if self.name is not None:
|
if self.name is not None:
|
||||||
msg = "Script {}: {}".format(self.name, msg, *substitutes)
|
msg = "Script {}: {}".format(self.name, msg)
|
||||||
|
|
||||||
_LOGGER.info(msg)
|
_LOGGER.info(msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user