mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Fix duplicate events in live history (#113896)
This commit is contained in:
parent
dfbfdf781e
commit
e74791083e
@ -5,7 +5,7 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
from collections.abc import Callable, Iterable, MutableMapping
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime as dt
|
||||
from datetime import datetime as dt, timedelta
|
||||
import logging
|
||||
from typing import Any, cast
|
||||
|
||||
@ -564,7 +564,10 @@ async def ws_stream(
|
||||
hass,
|
||||
connection,
|
||||
msg_id,
|
||||
last_event_time or start_time,
|
||||
# Add one microsecond so we are outside the window of
|
||||
# the last event we got from the database since otherwise
|
||||
# we could fetch the same event twice
|
||||
(last_event_time or start_time) + timedelta(microseconds=1),
|
||||
subscriptions_setup_complete_time,
|
||||
entity_ids,
|
||||
False, # We don't want the start time state again
|
||||
|
Loading…
x
Reference in New Issue
Block a user