-
Notifications
You must be signed in to change notification settings - Fork 51
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
Changed is_connected to return bool while maintaining error checking #125
Changed is_connected to return bool while maintaining error checking #125
Conversation
…purpose. Created new is_connected that returns a bool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good change, but I'm also not as familiar with MQTT applications. I think this is worth getting a second opinion since its also API breaking. I'll bring it up at the CircuitPython weekly meeting tomorrow!
After poking around in the code, I believe the If the MQTT broker is down, the After poking the code a bit more, Perhaps the method should be renamed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! However, I think it could be written more simply. Do you mind changing it around?
Thanks to @2bndy5 for clarifying my thinking and pointing out that the Paho implementation returns a |
Updating https://github.com/adafruit/Adafruit_CircuitPython_CharLCD to 3.4.4 from 3.4.3: > Merge pull request adafruit/Adafruit_CircuitPython_CharLCD#73 from BiffoBear/add_typing > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to 5.1.19 from 5.1.18: > Merge pull request adafruit/Adafruit_CircuitPython_LIS3DH#73 from crotwell/extra_underscore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_SharpMemoryDisplay to 1.4.6 from 1.4.5: > Merge pull request adafruit/Adafruit_CircuitPython_SharpMemoryDisplay#22 from grouma/main > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 6.0.0 from 5.5.2: > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#125 from BiffoBear/Make_is_connected_return_bool > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions
closes #109
Renamed original is_connected method to _connected to maintain internal connection status checking. Created a new is_connected function that returns a bool. This is a breaking change.
This change allows code to be written like: