aioespnow,webrepl: Use recommended network.WLAN.IF_[AP|STA] constants.

Removes the deprecated network.[AP|STA]_IF form.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
pull/933/head
Angus Gratton 2024-11-05 11:20:03 +11:00 zatwierdzone przez Damien George
rodzic d6faaf8472
commit a0ceed8269
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -55,7 +55,7 @@ A small async server example::
import asyncio
# A WLAN interface must be active to send()/recv()
network.WLAN(network.STA_IF).active(True)
network.WLAN(network.WLAN.IF_STA).active(True)
e = aioespnow.AIOESPNow() # Returns AIOESPNow enhanced with async support
e.active(True)

Wyświetl plik

@ -102,7 +102,7 @@ def setup_conn(port, accept_handler):
listen_s.listen(1)
if accept_handler:
listen_s.setsockopt(socket.SOL_SOCKET, 20, accept_handler)
for i in (network.AP_IF, network.STA_IF):
for i in (network.WLAN.IF_AP, network.WLAN.IF_STA):
iface = network.WLAN(i)
if iface.active():
print("WebREPL server started on http://%s:%d/" % (iface.ifconfig()[0], port))