Skip to content

Commit eb6c942

Browse files
authored
Merge pull request #56 from flavio-fernandes/fix_pyportal_example
examples: update minimqtt_pub_sub_pyportal.py
2 parents e02d658 + 507823f commit eb6c942

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

examples/minimqtt_pub_sub_pyportal.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# SPDX-License-Identifier: MIT
33

44
import time
5-
from adafruit_esp32spi import adafruit_esp32spi_wifimanager
65
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
76
import adafruit_pyportal
87

@@ -19,9 +18,6 @@
1918
print("WiFi secrets are kept in secrets.py, please add them there!")
2019
raise
2120

22-
# pylint: disable=protected-access
23-
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(pyportal._esp, secrets, None)
24-
2521
# ------------- MQTT Topic Setup ------------- #
2622
mqtt_topic = "test/topic"
2723

@@ -51,12 +47,12 @@ def message(client, topic, message):
5147

5248
# Connect to WiFi
5349
print("Connecting to WiFi...")
54-
wifi.connect()
50+
pyportal.network.connect()
5551
print("Connected!")
5652

5753
# Initialize MQTT interface with the esp interface
5854
# pylint: disable=protected-access
59-
MQTT.set_socket(socket, pyportal._esp)
55+
MQTT.set_socket(socket, pyportal.network._wifi.esp)
6056

6157
# Set up a MiniMQTT Client
6258
mqtt_client = MQTT.MQTT(

0 commit comments

Comments
 (0)