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 MQTT Support #258

Closed
wants to merge 12 commits into from
Closed

Conversation

mmjsmohit
Copy link
Contributor

@mmjsmohit mmjsmohit commented Mar 5, 2024

PR Description

This PR adds support for MQTT v3 (3.1 and 3.1.1) Client Testing using the mqtt_client package.

  1. The foundation of our MQTT service has been expanded with the addition of new models.
  2. A working version of our MQTT service has been successfully implemented.
  3. I've added support for MQTT topic subscriptions, allowing users to subscribe to multiple topics at once.
  4. Some level of error handling has been taken care of. I plan to make a separate PR for writing and fixing tests and implementing comprehensive level of error handling.

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have run the tests (flutter test) and all tests are passing.

Some tests are failing, I plan to make a separate PR for fixing and writing more tests.

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: I plan to make a separate PR for adding tests.

@mmjsmohit
Copy link
Contributor Author

@ashitaprasad @animator Would love to receive your inputs on the current implementation!

Go API Dash! 🫶🏻

@ashitaprasad ashitaprasad linked an issue Mar 5, 2024 that may be closed by this pull request
@khanjasir90
Copy link

@mmjsmohit can we use json_serializable for to and from json code generation and equatable for ==.
@ashitaprasad what's your take on this.

@mmjsmohit
Copy link
Contributor Author

@mmjsmohit can we use json_serializable for to and from json code generation and equatable for ==. @ashitaprasad what's your take on this.

Sure! That's a good suggestion @khanjasir90 considering the model classes are fairly complex. Currently, I am busy with my mid-terms. Will add that soon.

@animator
Copy link
Member

@mmjsmohit Please make this change #307

@mmjsmohit
Copy link
Contributor Author

Required changes made!

protocol.dropdown.mp4

@ashitaprasad
Copy link
Member

@mmjsmohit Can you resolve the conflicts for this PR.
Some feedback on the existing implementation :
State management of the values being entered is not correct. When the user switches screens, the values disappear.

mohit.feedback.mov

And change the color of the switch from purple. Keep it in accordance with the theme of API Dash

@mmjsmohit
Copy link
Contributor Author

Hi @ashitaprasad,

I’ve resolved the conflicts in the PR and also migrated to DataTable2 from DaviTable. Additionally, I’ve made several UI fixes. You can find more details in the video and screenshots below:

Light Mode:

Screenshot from 2024-04-05 16-05-43

Dark Mode:

Screenshot from 2024-04-05 16-02-46

Video:

Screencast.from.2024-04-05.16-15-58.webm

@ashitaprasad
Copy link
Member

@mmjsmohit There is an issue in the implementation. Every time, I create a new MQTT request, automatically the response and request fields of the previous MQTT request gets filled. This should not happen.

@mmjsmohit
Copy link
Contributor Author

I am currently enhancing the handling of MQTT requests to ensure robustness. Should I create a new model specifically for MQTT, or would it be better to modify the existing request model?

@ashitaprasad
Copy link
Member

@mmjsmohit It should be a new model.

@ashitaprasad
Copy link
Member

Closing this PR as request model has now been updated.

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.

Add Support for MQTT
4 participants