diff --git a/examples/minimqtt_pub_sub_pyportal.py b/examples/minimqtt_pub_sub_pyportal.py index c32145af..6409cdd0 100644 --- a/examples/minimqtt_pub_sub_pyportal.py +++ b/examples/minimqtt_pub_sub_pyportal.py @@ -2,7 +2,6 @@ # SPDX-License-Identifier: MIT import time -from adafruit_esp32spi import adafruit_esp32spi_wifimanager import adafruit_esp32spi.adafruit_esp32spi_socket as socket import adafruit_pyportal @@ -19,9 +18,6 @@ print("WiFi secrets are kept in secrets.py, please add them there!") raise -# pylint: disable=protected-access -wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(pyportal._esp, secrets, None) - # ------------- MQTT Topic Setup ------------- # mqtt_topic = "test/topic" @@ -51,12 +47,12 @@ def message(client, topic, message): # Connect to WiFi print("Connecting to WiFi...") -wifi.connect() +pyportal.network.connect() print("Connected!") # Initialize MQTT interface with the esp interface # pylint: disable=protected-access -MQTT.set_socket(socket, pyportal._esp) +MQTT.set_socket(socket, pyportal.network._wifi.esp) # Set up a MiniMQTT Client mqtt_client = MQTT.MQTT(