Skip to content

Commit

Permalink
do not repeat helobytes
Browse files Browse the repository at this point in the history
  • Loading branch information
kbpk authored Jan 12, 2025
1 parent 0aa4df3 commit ae31a78
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions miio/miioprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ def discover(addr: Optional[str] = None, timeout: int = 5) -> Any:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.settimeout(timeout)
for _ in range(3):
s.sendto(helobytes, (addr, 54321))
s.sendto(helobytes, (addr, 54321))

Check warning on line 122 in miio/miioprotocol.py

View check run for this annotation

Codecov / codecov/patch

miio/miioprotocol.py#L122

Added line #L122 was not covered by tests
while True:
try:
data, recv_addr = s.recvfrom(1024)
Expand Down

0 comments on commit ae31a78

Please sign in to comment.