Skip to content

the property did not work before. now it does what you expect - return true or false #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion adafruit_io/adafruit_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import json
import re

from adafruit_minimqtt.adafruit_minimqtt import MMQTTException
from adafruit_io.adafruit_io_errors import (
AdafruitIO_RequestError,
AdafruitIO_ThrottleError,
Expand Down Expand Up @@ -117,7 +118,10 @@ def disconnect(self):
@property
def is_connected(self):
"""Returns if connected to Adafruit IO MQTT Broker."""
return self._client.is_connected
try:
return self._client.is_connected()
except MMQTTException:
return False

# pylint: disable=not-callable, unused-argument
def _on_connect_mqtt(self, client, userdata, flags, return_code):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

Adafruit-Blinka
Adafruit_CircuitPython_ESP32SPI
Adafruit_CircuitPython_MiniMQTT