Get rid of timeout on readline

This commit is contained in:
atse 2024-08-26 15:21:26 +08:00
parent 4240312bf4
commit 375e159c39

View File

@ -13,7 +13,6 @@ class AsyncioClient:
self._writer = None self._writer = None
self._command_lock = asyncio.Lock() self._command_lock = asyncio.Lock()
self._report_mode_on = False self._report_mode_on = False
self.timeout = None
async def connect(self, host="192.168.1.26", port=23): async def connect(self, host="192.168.1.26", port=23):
"""Connect to Thermostat at specified host and port. """Connect to Thermostat at specified host and port.
@ -54,9 +53,7 @@ class AsyncioClient:
async def _read_line(self): async def _read_line(self):
# read 1 line # read 1 line
chunk = await asyncio.wait_for( chunk = await self._reader.readline()
self._reader.readline(), self.timeout
) # Only wait for response until timeout
return chunk.decode("utf-8", errors="ignore") return chunk.decode("utf-8", errors="ignore")
async def _read_write(self, command): async def _read_write(self, command):