Merge pull request #126 from andythigpen/script-utc

Fix UTC issue with script component.
This commit is contained in:
Paulus Schoutsen 2015-05-14 17:30:26 -07:00
commit 3f8fd8aa09

View File

@ -6,7 +6,8 @@ Scripts are a sequence of actions that can be triggered manually
by the user or automatically based upon automation events, etc. by the user or automatically based upon automation events, etc.
""" """
import logging import logging
from datetime import datetime, timedelta from datetime import timedelta
import homeassistant.util.dt as date_util
import threading import threading
from homeassistant.util import split_entity_id from homeassistant.util import split_entity_id
@ -109,7 +110,7 @@ class Script(object):
self._call_service(action) self._call_service(action)
elif CONF_DELAY in action: elif CONF_DELAY in action:
delay = timedelta(**action[CONF_DELAY]) delay = timedelta(**action[CONF_DELAY])
point_in_time = datetime.now() + delay point_in_time = date_util.now() + delay
self.listener = self.hass.track_point_in_time( self.listener = self.hass.track_point_in_time(
self, point_in_time) self, point_in_time)
return False return False