MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / check_internet

Function check_internet

src/astroprint/api/setup.py:63–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61@api.route('/setup/internet', methods=['GET'])
62@not_setup_only
63def check_internet():
64 nm = networkManager()
65
66 if nm.isAstroprintReachable():
67 return jsonify(connected = True)
68 else:
69 networks = nm.getWifiNetworks()
70
71 if networks:
72 return jsonify(networks = networks, connected = False)
73 else:
74 return make_response("Unable to get WiFi networks", 500)
75
76@api.route('/setup/internet', methods=['POST'])
77@not_setup_only

Callers

nothing calls this directly

Calls 3

networkManagerFunction · 0.90
isAstroprintReachableMethod · 0.45
getWifiNetworksMethod · 0.45

Tested by

no test coverage detected