Fix for time_date sensor (#10694)

* fix to time_date sensor

* cleaned up the code and added unit tests

* fixed lint errors
This commit is contained in:
Egor Tsinko authored and Paulus Schoutsen committed 2017-11-19 19:41:30 -08:00
1 parent 3f5c748560
commit 7695ca2c8b
2 files changed
+23 -6

No files matched your search

+1 -1
View File
@@ -90,7 +90,7 @@ class TimeDateSensor(Entity):
if now is None:
now = dt_util.utcnow()
if self.type == 'date':
now = dt_util.start_of_local_day(now)
now = dt_util.start_of_local_day(dt_util.as_local(now))
return now + timedelta(seconds=86400)
elif self.type == 'beat':
interval = 86.4