-
Notifications
You must be signed in to change notification settings - Fork 635
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
MQTT will topic is set before /get suffix initialization #2106
Comments
Yep, order looks wrong here. |
I would make an adjustment and pull request but I don't feel like guessing the correct code style or layout. I never seen usage of braces to separate blocks of code in one function and I don't do c code so often. I guess move |
Thanks! Any place would do, can be near json topic for example. Braces have 2 reasons here:
|
@mcspr thank you for explanation, I hope my pull request meats your standards :-) |
Bug description
When MQTT getter suffix is defined it is ignored by MQTT last will topic. I think it is because it is initialized before getter / setter initialization on this line
espurna/code/espurna/mqtt.ino
Line 332 in e638aab
espurna/code/espurna/mqtt.ino
Line 342 in e638aab
Steps to reproduce
#define MQTT_GETTER "/get"
isCUSTOM.h
Expected behavior
When i want to use custom getter suffix i expect to have it everywhere.
espurna/XAXAXAXAXAXA/status/get 0
(Now wrongespurna/XAXAXAXAXAXA/status 0
)espurna/XAXAXAXAXAXA/status/get 1
(Now correctespurna/XAXAXAXAXAXA/status/get 1
because topic is initialized ad-hoc)Device information
The text was updated successfully, but these errors were encountered: