Skip to content

Commit 912d8f7

Browse files
author
brentru
committed
update pyportal aio planter
1 parent d5d5e71 commit 912d8f7

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

pyportal_pet_planter/code.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from adafruit_bitmap_font import bitmap_font
1212
from adafruit_display_text.label import Label
1313
from adafruit_io.adafruit_io import IO_MQTT
14-
from adafruit_minimqtt import MQTT
14+
import adafruit_minimqtt as MQTT
1515
from adafruit_pyportal import PyPortal
1616
from adafruit_seesaw.seesaw import Seesaw
1717
from simpleio import map_range
@@ -181,14 +181,13 @@
181181
continue
182182
print("Connected to WiFi!")
183183

184-
# Initialize a new MiniMQTT Client object
185-
mqtt_client = MQTT(
186-
socket=socket,
187-
broker="io.adafruit.com",
188-
username=secrets["aio_username"],
189-
password=secrets["aio_key"],
190-
network_manager=wifi
191-
)
184+
# Initialize MQTT interface with the esp interface
185+
MQTT.set_socket(socket, esp)
186+
187+
# Initialize a new MQTT Client object
188+
mqtt_client = MQTT.MQTT(broker="https://io.adafruit.com",
189+
username=secrets["aio_user"],
190+
password=secrets["aio_key"])
192191

193192
# Adafruit IO Callback Methods
194193
# pylint: disable=unused-argument

0 commit comments

Comments
 (0)