Skip to content

umqtt.simple: Added call to main() function in example scripts#199

Merged
dpgeorge merged 1 commit into
micropython:masterfrom
spynappels:fix_umqtt.simple_example_sub_led.py
Jul 1, 2026
Merged

umqtt.simple: Added call to main() function in example scripts#199
dpgeorge merged 1 commit into
micropython:masterfrom
spynappels:fix_umqtt.simple_example_sub_led.py

Conversation

@spynappels

Copy link
Copy Markdown

Added call to main() function at end of script after the function definition. Matches other example scripts in umqtt.simple lib and is tested as functional on ESP8266 with MicroPython 1.9.1

Stefan

@dpgeorge

Copy link
Copy Markdown
Member

The example_sub.py and example_pub.py scripts do have this call to main(), but not the example_sub_led.py and example_pub_button.py scripts. So the latter pair either stay as they are, or both should have main() added to the end like is done here.

@spynappels

Copy link
Copy Markdown
Author

@dpgeorge No problem, I have added an additional commit adding the call to example_pub_button.py too.

@spynappels spynappels changed the title umqtt.simple: Added call to main() function in example script umqtt.simple: Added call to main() function in example scripts Jul 21, 2017
@pfalcon

pfalcon commented Aug 20, 2017

Copy link
Copy Markdown
Contributor

@dpgeorge dpgeorge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for updating, and sorry this took forever to get back to.

This change looks fine, it makes all the examples consistent in calling main().

Added call to `main()` function at end of script after the function
definition.  Matches other example scripts in `umqtt.simple` lib.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the fix_umqtt.simple_example_sub_led.py branch from 18cc5d6 to 1852c01 Compare July 1, 2026 02:24
@dpgeorge dpgeorge merged commit 1852c01 into micropython:master Jul 1, 2026
5 checks passed
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.

3 participants