peterhinch / micropython-mqtt

A 'resilient' asynchronous MQTT driver. Recovers from WiFi and broker outages.
MIT License
549 stars 116 forks source link

Gateway class receive config params instead of importing hardcoded #131

Closed vencax closed 4 months ago

vencax commented 4 months ago

Hello, I needed to inject config to Gateway instead of importing hardcoded ones. I think the changes can be handy. Doc updated. Feel free to give me a feedback.

peterhinch commented 4 months ago

This is a breaking change. Please explain how this benefits the typical user.

The mqtt_local.py config file is familiar to users of mqtt_as, and the gwconfig.py contains specific configs for the gateway. As the docs state, the user can get started simply by editing three lines in mqtt_local.py. It's hard to see how installation could be any simpler.

vencax commented 4 months ago

I got your point. My point of view is that configuration passing done through mutually imported constants is not transparent. For me was bit tricky to track it. But since you are convinced, that users are used to it, it is ok for me. I can use your way as well. I close this PR for now. THanks for the feedback.