esphome / esphome/feature-requests

Self-Documenting Components

Open
#750 0 comments 4 reactions 0 assignees View on GitHub
Type: Documentation
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

While the ESPHome project is great, the documentation of components is not as comprehensive as it could be.

I would like that all the following items are shown on the component page:
- configuration variables (already there)
- `it` member variables and functions available in lambdas

The other issue is that the current documentation seems to be manually managed. This could cause the documentation to rapidly fall out of date and it is very hard to track this problem.

My suggested solution is to have the documentation inside the code or generated from the code. This somewhat happens with the doxygen build step but I find doxygen painful to use and the situation would be even worse for newcomers.

_Configuration Variables_

The config variables could be inferred from the CONFIG_SCHEMA in .py file of each component.

It seems like it wouldn't be too difficult to modify this schema definition to have an inbuilt documentation. Although it would be time consuming to add this information manually, if the current hierarchical system is preserved it could be done mostly automatically.

_Lambda Variables/Functions_

This can be scraped from the doxygen comments in source of public variables and functions. But such documentation is non-existent in the components I've looked at.

**Please describe your use case for this integration and alternatives you've tried:**

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the CONFIG_SCHEMA definitions in component .py files and the existing documentation generation or Doxygen build step mentioned in the request. Define the scope and source of truth for configuration and lambda API documentation before identifying implementation files; done should mean component pages stay synchronized with the documented code.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.