Skip to content

Contributing

If the behavior of this library does not fit your needs, or you want to improve it, or add features: please make a pull request.

Adding or changing a component

  1. Check the component page on home-assistant.io: the doc page is the source of truth for which options are Required vs Optional.
  2. Add or update the component class in src/MycilaHADiscovery.h, following the existing conventions:
  3. Required topics are constructor arguments; optional topics are std::string fields
  4. Add an id-only constructor (X(std::string id)) so entities can be removed with unpublish<X>(id) alone
  5. Payloads and templates are borrowed const char*
  6. Values whose omission lets Home Assistant apply its default are std::optional and are not emitted when unset
  7. Validate every JSON key you emit against Home Assistant's abbreviation list.
  8. Build an example with pio run -e ci-arduino-3 and run cpplint as configured in the CI workflow.
  9. Update the matching page under docs/components/.

Documentation

The website is built with mkdocs-material from this repository (mkdocs.yml + docs/), and published to GitHub Pages by the website.yml workflow. To preview locally:

pip install mkdocs-material
mkdocs serve