Thank you for considering contributing to our project! We appreciate your efforts to make our project better.
Before you start contributing, please take a moment to review the following guidelines.
If you encounter a bug in the project, please open an issue on GitHub and provide the detailed information about the bug, including the steps to reproduce the bug, the logs of debug level and the time when it occurs.
The method to set the integration's log level:
# Set the log level in configuration.yaml
logger:
default: critical
logs:
custom_components.xiaomi_home: debug
If you have ideas for enhancements or new features, you are welcomed to start a discussion on ideas on GitHub to discuss your ideas.
- Fork the repository and create your branch from
main
. - Ensure that your code adheres to the project coding standard.
- Make sure that your commit messages are descriptive and meaningful.
- Pull requests should be accompanied by a clear description of the problem and the solution.
- Update the documents if necessary.
- Run tests if they are available and ensure they pass.
Before submitting a pull request, please make sure that the following requirements are met:
- Your pull request addresses a single issue or feature.
- You have tested your changes locally.
- Your code follows the project's code style. Run
pylint
over your code using this pylintrc. - All existing tests pass, and you have added new tests if applicable.
- Any dependent changes are documented.
We follow Google Style for code style and formatting. Please make sure to adhere to this guideline in your contributions.
<type>: <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
type: commit type is one of the following
- feat: A new feature.
- fix: A bug fix.
- docs: Documentation only changes.
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.).
- refactor: A code change that neither fixes a bug nor adds a feature.
- perf: A code change that improves performance.
- test: Adding missing tests or correcting existing tests.
- chore: Changes to the build process or auxiliary tools and libraries.
- revert: Reverting a previous commit.
subject: A short summary in imperative, present tense. Not capitalized. No period at the end.
body: A detailed description of the commit and the motivation for the change. The body is mandatory for all commits except for those of type "docs".
footer: Optional. The footer is the place to reference GitHub issues and PRs that this commit closes or is related to.
- When describing Xiaomi, always use "Xiaomi" in full. Variable names can use "xiaomi" or "mi".
- When describing Xiaomi Home, always use "Xiaomi Home". Variable names can use "mihome" or "MiHome".
- When describing Xiaomi IoT, always use "MIoT". Variable names can use "miot" or "MIoT".
- When describing Home Assistant, always use "Home Assistant". Variables can use "hass" or "hass_xxx".
- When using mixed Chinese and English sentences in the document, there must be a space between Chinese and English or the English words must be quoted by Chinese quotation marks. (It is best to write code comments this way too.)
When contributing to this project, you agree that your contributions will be licensed under the project's LICENSE.
If you need help or have questions, feel free to ask in discussions on GitHub.
You can also contact ha_xiaomi_home@xiaomi.com