Skip to content
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

Extended error reporting on connect #219

Closed
wants to merge 3 commits into from
Closed

Conversation

Pacifica15
Copy link

_open_mqtt_connection does not fire on_connect if Roomba refuses connection, so that client_error will stay empty in that case.
Extended the connect method to add this scenario.

@@ -71,12 +71,15 @@ def connect(self):
self._open_mqtt_connection()
return True
except Exception as e:
_last_error = "Can't connect to {}, error: {}".format(self.address, e)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not store this as a class attribute?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it's only needed during connect and the value is passed to the caller by on_connect, I think it's better to leave it local.

Copy link
Owner

@pschmitt pschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As stated in #218 I don't want to add py3.7 support back in.

@pschmitt pschmitt closed this Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants