Skip to content

Commit 57e97d7

Browse files
committed
Fix wait for task
1 parent dc7c7ea commit 57e97d7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pymyq/device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import asyncio
33
import logging
44
from datetime import datetime
5-
from typing import TYPE_CHECKING, Optional, Tuple
5+
from typing import TYPE_CHECKING, Optional, Tuple, List
66

77
from .const import DEVICE_TYPE, WAIT_TIMEOUT
88
from .errors import RequestError, MyQError
@@ -118,7 +118,7 @@ async def update(self) -> None:
118118
"""Get the latest info for this device."""
119119
await self._api.update_device_info()
120120

121-
async def wait_for_state(self, current_state: Tuple, new_state: Tuple, last_state_update: datetime) -> bool:
121+
async def wait_for_state(self, current_state: List, new_state: List, last_state_update: datetime) -> bool:
122122
# First wait until door state is actually updated.
123123
_LOGGER.debug(f"Waiting until device state has been updated for {self.name}")
124124
wait_timeout = WAIT_TIMEOUT

pymyq/garagedoor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ async def close(self, wait_for_state: bool = False) -> Union[asyncio.Task, bool]
7878
return True
7979

8080
wait_for_state_task = asyncio.create_task(self.wait_for_state(
81-
current_state=tuple(STATE_OPENING),
82-
new_state=tuple(STATE_OPEN),
81+
current_state=[STATE_OPENING],
82+
new_state=[STATE_OPEN],
8383
last_state_update=self.device_json["state"].get("last_update"),
8484
), name="MyQ_WaitForClose",
8585
)
@@ -104,8 +104,8 @@ async def open(self, wait_for_state: bool = False) -> Union[asyncio.Task, bool]:
104104
self.state = STATE_OPENING
105105

106106
wait_for_state_task = asyncio.create_task(self.wait_for_state(
107-
current_state=tuple(STATE_OPENING),
108-
new_state=tuple(STATE_OPEN),
107+
current_state=[STATE_OPENING],
108+
new_state=[STATE_OPEN],
109109
last_state_update=self.device_json["state"].get("last_update"),
110110
), name="MyQ_WaitForOpen",
111111
)

0 commit comments

Comments
 (0)