Skip to content

Commit

Permalink
Fix online check to keep connected in state 3
Browse files Browse the repository at this point in the history
Online check was incorrectly including state 3 (Connected with IP) as a condition to disconnect and retry, adjusted to include only state numbers below this.
  • Loading branch information
sjefferson99 authored Apr 22, 2024
1 parent 21e0a18 commit de9510b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion enviro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def wait_status(expected_status, *, timeout=10, tick_sleep=0.5):

# Disconnect when necessary
status = dump_status()
if status >= CYW43_LINK_JOIN and status <= CYW43_LINK_UP:
if status >= CYW43_LINK_JOIN and status < CYW43_LINK_UP:
logging.info("> Disconnecting...")
wlan.disconnect()
try:
Expand Down

0 comments on commit de9510b

Please sign in to comment.