Skip to content

Commit

Permalink
Use HTTP instead of ICMP for network connectivity check
Browse files Browse the repository at this point in the history
- Fixes #53
  • Loading branch information
judahpaul16 committed Jun 10, 2024
1 parent 7133265 commit 6eca5f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def success(self, message, *args, **kws):
display_lock = asyncio.Lock()

def network_connected():
return os.system("ping -c 1 google.com") == 0
try:
response = requests.get("http://www.google.com", timeout=5)
return response.status_code == 200
except requests.RequestException:
return False

# Manually draw a degree symbol °
def degree_symbol(display, x, y, radius, color):
Expand Down

0 comments on commit 6eca5f6

Please sign in to comment.