Fix flaky test in history stats (#131869)

This commit is contained in:
karwosts 2024-11-28 11:51:23 -08:00 committed by Franck Nijhof
parent 2ea0c54788
commit ee960933db
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -459,7 +459,11 @@ async def test_async_on_entire_period(
def _fake_states(*args, **kwargs):
return {
"binary_sensor.test_on_id": [
ha.State("binary_sensor.test_on_id", "on", last_changed=start_time),
ha.State(
"binary_sensor.test_on_id",
"on",
last_changed=(start_time - timedelta(seconds=10)),
),
ha.State("binary_sensor.test_on_id", "on", last_changed=t0),
ha.State("binary_sensor.test_on_id", "on", last_changed=t1),
ha.State("binary_sensor.test_on_id", "on", last_changed=t2),