Fix date-only input_datetime timestamp attribute to use the correct TZ (#174357)

This commit is contained in:
karwosts
2026-06-24 17:15:09 +02:00
committed by GitHub
parent 0808e30e37
commit dc6eef2844
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -344,7 +344,9 @@ async def test_set_datetime_date(hass: HomeAssistant) -> None:
assert not state.attributes["has_time"]
assert state.attributes["has_date"]
date_dt_obj = datetime.datetime(2017, 9, 7)
date_dt_obj = datetime.datetime(
2017, 9, 7, tzinfo=dt_util.get_time_zone(hass.config.time_zone)
)
assert state.attributes["timestamp"] == date_dt_obj.timestamp()