Use event loop scheduling for tracking time patterns (#38021)
* Use event loop scheduling for tracking time patterns * make patching of time targetable * patch time tests since time can tick to match during the test * fix more tests * time can only move forward * time can only move forward * back to 100% coverage * simplify since the event loop time cannot move backwards * simplify some more * revert simplify * Revert "revert simplify" This reverts commitbd42f232f6
. * Revert "simplify some more" This reverts commit2a6c57d514
. * Revert "simplify since the event loop time cannot move backwards" This reverts commit3b13714ef4
. * Attempt another simplify * time does not move backwards in the last two * remove next_time <= now check * fix previous merge error
This commit is contained in:
parent
7bc8caca96
commit
60009ec2f9
9 changed files with 404 additions and 199 deletions
|
@ -46,7 +46,11 @@ async def test_if_fires_using_at(hass, calls):
|
|||
},
|
||||
)
|
||||
|
||||
async_fire_time_changed(hass, dt_util.utcnow().replace(hour=5, minute=0, second=0))
|
||||
now = dt_util.utcnow()
|
||||
|
||||
async_fire_time_changed(
|
||||
hass, now.replace(year=now.year + 1, hour=5, minute=0, second=0)
|
||||
)
|
||||
|
||||
await hass.async_block_till_done()
|
||||
assert len(calls) == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue