Skip to content

Commit b58a4f1

Browse files
authored
Merge pull request #15 from rakete/rakete
add READ_TIMEOUT=15 and use in _receive_response
2 parents 7eb00e0 + 6a30f21 commit b58a4f1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

bydhvs/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class BYDHVS:
3737
MAX_CELLS = 160
3838
MAX_TEMPS = 64
3939
SLEEP_TIME = 4
40+
READ_TIMEOUT = 15
4041

4142
def __init__(self, ip_address: str, port: int = 8080) -> None:
4243
"""Initialize the BYDHVS communication class."""
@@ -250,7 +251,7 @@ async def _receive_response(self) -> Optional[bytes]:
250251
if self._reader:
251252
try:
252253
data = await asyncio.wait_for(
253-
self._reader.read(1024), timeout=5
254+
self._reader.read(1024), timeout=self.READ_TIMEOUT
254255
)
255256
_LOGGER.debug("Received: %s", data.hex())
256257
return data

0 commit comments

Comments
 (0)