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:
1 parent
3f5c748560
commit
7695ca2c8b
2 files changed
+23
-6
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user