Skip to content

Commit

Permalink
Update retries timings
Browse files Browse the repository at this point in the history
  • Loading branch information
bannhead committed Jul 5, 2020
1 parent 77fc73c commit 4c4cb5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyaehw4a1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from . import *
__version__ = '0.3.8'
__version__ = '0.3.9'
6 changes: 3 additions & 3 deletions pyaehw4a1/aehw4a1.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def _read_command(self, command):
)

async def _send_recv_packet(self, command):
for i in range(3):
for i in range(5):
try:
reader, writer = await asyncio.wait_for(
asyncio.open_connection(self._host, 8888), timeout = 2)
Expand All @@ -130,11 +130,11 @@ async def _send_recv_packet(self, command):
else:
raise ConnectionError(f"AC unavailable") from None

for i in range(3):
for i in range(5):
writer.write(command.value)
await writer.drain()
try:
data = await asyncio.wait_for(reader.read(100), timeout = 3)
data = await asyncio.wait_for(reader.read(100), timeout = 2)
writer.close()
await writer.wait_closed()
except:
Expand Down

0 comments on commit 4c4cb5d

Please sign in to comment.