TheZlodziej / mqtt-simulator

Python app that lets you simulate data flow over mqtt. It allows you to publish complex, random objects as well as simple value on given mqtt topic. Easy to setup and use from both GUI and CLI mode.
7 stars 1 forks source link

Function import json #3

Closed AnonymousWebHacker closed 5 months ago

AnonymousWebHacker commented 5 months ago

When you are modifying the topic and its time interval, it would be nice to have a json import instead of writing a whole string

TheZlodziej commented 5 months ago

I'll modify file command to accept None as separator so you can print out whole file

TheZlodziej commented 5 months ago

Thanks for this issue. You can in fact use file function for that, tho I changed the default separator to None so it reads whole file by default. I need to test it out so I'm gonna upload the changes later today. Current workaround is to put your json in one line and use "\n" separator or one that doesn't appear in json so the split text is going to evaluate to [ your_json ] list.

TheZlodziej commented 5 months ago

I will also add a button to import schema from file

TheZlodziej commented 5 months ago

@AnonymousWebHacker I've also added the import button during adding/editing topic.

Thanks again for both issues (this & #2). Let me know what you think.

AnonymousWebHacker commented 5 months ago

Thank you, it works as expected, it is an excellent function. If you are free, you could implement 2 or 3 more functions, and it would be perfect. Thanks for your code, I am running my project thanks to data generated by your mqtt-simulator :)

TheZlodziej commented 5 months ago

Let me know which functions you'd like me to add. I'll try to add those as well.