Fix utc issue with script component.

This commit is contained in:
Andrew Thigpen 2015-05-14 18:49:17 -05:00
parent fdb46d80ba
commit ef138bb132

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