Skip to content

Commit abd00c4

Browse files
committed
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 <[email protected]> Signed-off-by: Angus Gratton <[email protected]>
1 parent 68e3e07 commit abd00c4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

micropython/aioespnow/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ boards which include the `asyncio` module (ie. ESP8266 devices with at least
5050
A small async server example::
5151

5252
```python
53-
import network
53+
import network.WLAN
5454
import aioespnow
5555
import asyncio
5656

5757
# A WLAN interface must be active to send()/recv()
58-
network.WLAN(network.STA_IF).active(True)
58+
network.WLAN(network.WLAN.IF_STA).active(True)
5959

6060
e = aioespnow.AIOESPNow() # Returns AIOESPNow enhanced with async support
6161
e.active(True)

micropython/net/webrepl/webrepl.py

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

0 commit comments

Comments
 (0)