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

Discovery / publish initial values #309

Merged

Conversation

iprak
Copy link
Contributor

@iprak iprak commented Oct 20, 2022

This PR address the issue of devices initially appearing unavailable. The MQTT publish for discovery has been adjusted to allow executing a command at the end, the command being publishChannels.

MQTT_PublishAll and MQTT_PublishChannels were reversed and have been addressed as well.

This should close #252 as well.

@openshwprojects
Copy link
Owner

Passing a pointer to a string that has to be kept in memory is not a good practice, but... I understand that it might be necessary here. Doing a strdup or using a buffer would not be worth the effort.

The only other approach I'd consider would be just creating an enum , something like PostPublishCommand with options None, PublishAll, PublishChannels and using it instead of string command.... maybe it would be better....

because otherwise people might be tempted to pass a local char buffer[64]; as an argument and be surprised that it crashes

@iprak
Copy link
Contributor Author

iprak commented Oct 21, 2022

Yes that is a good idea. I have revised my changes.

@iprak
Copy link
Contributor Author

iprak commented Oct 21, 2022

@openshwprojects The BL602 build is failing. This commit (716133a) introduced the function add_dimmer with no return value.

@openshwprojects
Copy link
Owner

@iprak I just realized that and fixed, thx

@openshwprojects openshwprojects merged commit fe7c596 into openshwprojects:main Oct 21, 2022
@github-actions
Copy link

🎉 This PR is included in version 1.14.38 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@iprak iprak deleted the discovery-publish-channels branch November 1, 2022 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quibbles with light bulb autogenerated HA YAML
2 participants