mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
parent
69ec7980ad
commit
c7ff8d4996
@ -282,6 +282,13 @@ class HistoryStatsSensor(Entity):
|
|||||||
if end is None:
|
if end is None:
|
||||||
end = start + self._duration
|
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
|
self._period = start, end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user