Fix integration trapezoidal test (#93494)
parent
41aa3e223e
commit
33c2cb9895
|
@ -217,10 +217,11 @@ async def test_trapezoidal(hass: HomeAssistant) -> None:
|
||||||
hass.states.async_set(entity_id, 0, {})
|
hass.states.async_set(entity_id, 0, {})
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# Testing a power sensor with non-monotonic intervals and values
|
start_time = dt_util.utcnow()
|
||||||
for time, value in [(20, 10), (30, 30), (40, 5), (50, 0)]:
|
with freeze_time(start_time) as freezer:
|
||||||
now = dt_util.utcnow() + timedelta(minutes=time)
|
# Testing a power sensor with non-monotonic intervals and values
|
||||||
with freeze_time(now):
|
for time, value in [(20, 10), (30, 30), (40, 5), (50, 0)]:
|
||||||
|
freezer.move_to(start_time + timedelta(minutes=time))
|
||||||
hass.states.async_set(
|
hass.states.async_set(
|
||||||
entity_id,
|
entity_id,
|
||||||
value,
|
value,
|
||||||
|
|
Loading…
Reference in New Issue