Skip to content

Commit 6762cc7

Browse files
author
brentru
committed
add tested code to reflect minimqtt commit 35ba546
1 parent 5a7e3bd commit 6762cc7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_io/adafruit_io.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __init__(self, mqtt_client):
6969
)
7070
# MiniMQTT's username kwarg is optional, IO requires a username
7171
try:
72-
self._user = self._client._user
72+
self._user = self._client.user
7373
except:
7474
raise TypeError(
7575
"Adafruit IO requires a username, please set one in MiniMQTT"
@@ -86,7 +86,7 @@ def __init__(self, mqtt_client):
8686
self._client.on_message = self._on_message_mqtt
8787
self._logger = False
8888
# Write to the MiniMQTT logger, if avaliable.
89-
if self._client._logger is not None:
89+
if self._client.logger is not None:
9090
self._logger = True
9191
self._client.set_logger_level("DEBUG")
9292
self._connected = False
@@ -427,7 +427,7 @@ class IO_HTTP:
427427
"""
428428

429429
def __init__(self, adafruit_io_username, adafruit_io_key, wifi_manager):
430-
self.username = adafruit_io_username
430+
self._username = adafruit_io_username
431431
self.key = adafruit_io_key
432432
wifi_type = str(type(wifi_manager))
433433
if "ESPSPI_WiFiManager" in wifi_type or "ESPAT_WiFiManager" in wifi_type:
@@ -477,7 +477,7 @@ def _compose_path(self, path):
477477
"""Composes a valid API request path.
478478
:param str path: Adafruit IO API URL path.
479479
"""
480-
return "https://io.adafruit.com/api/v2/{0}/{1}".format(self.username, path)
480+
return "https://io.adafruit.com/api/v2/{0}/{1}".format(self._username, path)
481481

482482
# HTTP Requests
483483
def _post(self, path, payload):

0 commit comments

Comments
 (0)