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

Add support for redirect command #14

Merged
merged 3 commits into from
Aug 26, 2019
Merged

Conversation

egueli
Copy link
Contributor

@egueli egueli commented Aug 17, 2019

My Python library was failing due to unsupported command from server. Turns out it was a redirect request, that wasn't implemented yet in Python lib. Here's the implementation.

Copy link
Collaborator

@antohaUa antohaUa left a comment

Choose a reason for hiding this comment

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

Hi Egueli!
Before all - thx a lot for investigating redirect feature and creating this pull request.

Two things that i would like to discuss with you:

  1. If we have redirect message and reply status NO DATA we always should do connection redirect?
    Is it possible that redirect message will have other statuses? Should we handle them?
    You see I am not familiar enough with redirect feature - thus would like with your help to clarify library expectations and possible corner cases.
  2. In your pull request pay attention that Connection is Parent class for Blynk class - so we can just within exception handling modify self.port = <new_port> self. server = that already available for us. Next connect ( that usually goes after disconnect :) should do all further staff. No need to use Connection.init()

Thx in advance for your replies

@egueli
Copy link
Contributor Author

egueli commented Aug 26, 2019

Hi! I'll try to answer:

  1. I'm not familiar with the redirect command either, I just analyzed what kind of message and status was being sent by the server. I haven't found any documentation about the protocol, so I made an educated guess that the redirect command only happens once after the authorization is completed. It might happen that STATUS_NO_DATA is sent for other reasons. I can try making the code react specifically toMSG_REDIRECT.
  2. I'll try that, thanks!

@antohaUa antohaUa merged commit 2ebcf31 into blynkkk:master Aug 26, 2019
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