mirror of
https://github.com/esphome/esphome.git
synced 2025-08-10 12:27:46 +00:00
preen
This commit is contained in:
@@ -63,15 +63,18 @@ async def test_defer_fifo_simple(
|
|||||||
test_result_future: asyncio.Future[bool] = loop.create_future()
|
test_result_future: asyncio.Future[bool] = loop.create_future()
|
||||||
|
|
||||||
def on_state(state: EntityState) -> None:
|
def on_state(state: EntityState) -> None:
|
||||||
if isinstance(state, Event):
|
if not isinstance(state, Event):
|
||||||
if state.key == test_complete_entity.key:
|
return
|
||||||
|
|
||||||
if (
|
if (
|
||||||
state.event_type == "test_finished"
|
state.key == test_complete_entity.key
|
||||||
|
and state.event_type == "test_finished"
|
||||||
and not test_complete_future.done()
|
and not test_complete_future.done()
|
||||||
):
|
):
|
||||||
test_complete_future.set_result(True)
|
test_complete_future.set_result(True)
|
||||||
elif state.key == test_result_entity.key:
|
return
|
||||||
if not test_result_future.done():
|
|
||||||
|
if state.key == test_result_entity.key and not test_result_future.done():
|
||||||
if state.event_type == "passed":
|
if state.event_type == "passed":
|
||||||
test_result_future.set_result(True)
|
test_result_future.set_result(True)
|
||||||
elif state.event_type == "failed":
|
elif state.event_type == "failed":
|
||||||
|
Reference in New Issue
Block a user