We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c41b41 commit 8fa992eCopy full SHA for 8fa992e
tests/component/_utils.py
@@ -5,9 +5,10 @@
5
from datetime import timezone
6
7
from hightime import datetime as ht_datetime
8
+from nitypes.time.typing import AnyDateTime
9
10
-def _is_timestamp_close_to_now(timestamp: ht_datetime, tolerance_seconds: float = 1.0) -> bool:
11
+def _is_timestamp_close_to_now(timestamp: AnyDateTime, tolerance_seconds: float = 1.0) -> bool:
12
current_time = ht_datetime.now(timezone.utc)
13
time_diff = abs((timestamp - current_time).total_seconds())
14
return time_diff <= tolerance_seconds
0 commit comments