From 92f24903f15e99423a67c21a62ead41d2d0cd85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1lfi=20P=C3=A9ter?= Date: Sun, 3 Apr 2022 01:21:13 +0200 Subject: [PATCH] added get_ip() --- wifimgr.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wifimgr.py b/wifimgr.py index a697655..3252115 100644 --- a/wifimgr.py +++ b/wifimgr.py @@ -99,6 +99,13 @@ def do_connect(ssid, password): return connected +def get_ip(): + if wlan_sta.isconnected(): + return wlan_sta.ifconfig()[0] + else: + return None + + def send_header(client, status_code=200, content_length=None ): client.sendall("HTTP/1.0 {} OK\r\n".format(status_code)) client.sendall("Content-Type: text/html\r\n")