This commit is contained in:
Diogo Gomes authored and Paulus Schoutsen committed 2019-01-30 17:33:52 -08:00
1 parent 69ec7980ad
commit c7ff8d4996
1 file changed
+7
@@ -282,6 +282,13 @@ class HistoryStatsSensor(Entity):
if end is None:
end = start + self._duration
if start > dt_util.now():
# History hasn't been written yet for this period
return
if dt_util.now() < end:
# No point in making stats of the future
end = dt_util.now()
self._period = start, end