Fix recorder datetime annotations (#122214)

This commit is contained in:
Marc Mueller 2024-07-20 11:10:25 +02:00 committed by GitHub
parent a0332d049b
commit 768d20c645
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -950,7 +950,7 @@ async def test_stats_timestamp_conversion_is_reentrant(
) )
) )
def _insert_pre_timestamp_stat(date_time: datetime) -> None: def _insert_pre_timestamp_stat(date_time: datetime.datetime) -> None:
with session_scope(hass=hass) as session: with session_scope(hass=hass) as session:
session.add( session.add(
old_db_schema.StatisticsShortTerm( old_db_schema.StatisticsShortTerm(
@ -965,7 +965,7 @@ async def test_stats_timestamp_conversion_is_reentrant(
) )
) )
def _insert_post_timestamp_stat(date_time: datetime) -> None: def _insert_post_timestamp_stat(date_time: datetime.datetime) -> None:
with session_scope(hass=hass) as session: with session_scope(hass=hass) as session:
session.add( session.add(
db_schema.StatisticsShortTerm( db_schema.StatisticsShortTerm(
@ -1107,7 +1107,7 @@ async def test_stats_timestamp_with_one_by_one(
) )
) )
def _insert_pre_timestamp_stat(date_time: datetime) -> None: def _insert_pre_timestamp_stat(date_time: datetime.datetime) -> None:
with session_scope(hass=hass) as session: with session_scope(hass=hass) as session:
session.add_all( session.add_all(
( (
@ -1134,7 +1134,7 @@ async def test_stats_timestamp_with_one_by_one(
) )
) )
def _insert_post_timestamp_stat(date_time: datetime) -> None: def _insert_post_timestamp_stat(date_time: datetime.datetime) -> None:
with session_scope(hass=hass) as session: with session_scope(hass=hass) as session:
session.add_all( session.add_all(
( (
@ -1333,7 +1333,7 @@ async def test_stats_timestamp_with_one_by_one_removes_duplicates(
) )
) )
def _insert_pre_timestamp_stat(date_time: datetime) -> None: def _insert_pre_timestamp_stat(date_time: datetime.datetime) -> None:
with session_scope(hass=hass) as session: with session_scope(hass=hass) as session:
session.add_all( session.add_all(
( (
@ -1360,7 +1360,7 @@ async def test_stats_timestamp_with_one_by_one_removes_duplicates(
) )
) )
def _insert_post_timestamp_stat(date_time: datetime) -> None: def _insert_post_timestamp_stat(date_time: datetime.datetime) -> None:
with session_scope(hass=hass) as session: with session_scope(hass=hass) as session:
session.add_all( session.add_all(
( (

View File

@ -819,7 +819,7 @@ async def test_statistic_during_period_partial_overlap(
hass: HomeAssistant, hass: HomeAssistant,
hass_ws_client: WebSocketGenerator, hass_ws_client: WebSocketGenerator,
freezer: FrozenDateTimeFactory, freezer: FrozenDateTimeFactory,
frozen_time: datetime, frozen_time: datetime.datetime,
) -> None: ) -> None:
"""Test statistic_during_period.""" """Test statistic_during_period."""
client = await hass_ws_client() client = await hass_ws_client()