-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Update contributing.rst #4188
Update contributing.rst #4188
Conversation
WalkthroughThe recent updates to the contributing guidelines for the ESPHome project include enhancements to clarity and consistency. Changes encompass the use of more inclusive language, expanded instructions for documentation contributions, and clearer expectations for pull request submissions. The guidelines also outline standards for code quality and validation, ensuring that contributors have a comprehensive understanding of the process and requirements for successful participation. Changes
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
This method is also automatically loaded and invoked by the ESPHome core. An example of | ||
such a method can be seen below: | ||
This method is also automatically loaded and invoked by the ESPHome core. Here's an example of such a method: | ||
|
||
.. code-block:: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update this block to use async/await and also update the text below to remove all references to yield and use await.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See how this looks: 33d4838
(#4188)
guides/contributing.rst
Outdated
.. note:: | ||
|
||
**Code in** ``loop()``, ``update()`` **and** ``setup()`` **must not block**. Specifically, methods like ``delay()`` | ||
should be avoided and **delays longer than 10 ms are not permitted**. The reason for this is that ESPHome uses a | ||
single-threaded loop for all components -- if your component blocks, it will delay the whole loop, negatively | ||
impacting other components. This can result in a variety of problems such as network connections being lost. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe here give reference to this->set_timeout
or using a state-machine to handle "waiting" in loop for the state to become what is needed for the next stage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See how this looks: 33d4838
(#4188)
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 18
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
@@ -697,14 +747,28 @@ The next method that will be called with your component is ``loop()`` (or ``upda | |||
:apiclass:`PollingComponent`). These methods should retrieve the latest data from your component and publish them with | |||
the provided methods. | |||
|
|||
.. note:: | |||
Finally, your component must have a ``dump_config`` method that prints the complete user configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when dump_config
is an required method to be override. would it not good idea to change up the Component class by changing "Virtual dump_config() {}
" into "Virtual dump_config() = 0;
"?
Description:
Various updates, particularly around PR submission. Lots of other tweaks & copy fixes/corrections.
Related issue (if applicable): fixes
Pull request in esphome with YAML changes (if applicable): esphome/esphome#
Checklist:
I am merging into
next
because this is new documentation that has a matching pull-request in esphome as linked above.or
I am merging into
current
because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.Link added in
/index.rst
when creating new documents for new components or cookbook.