Thank you for your interest in contributing to the Lark Integration for Home Assistant! This document provides guidelines and instructions for contributing.
- Fork the repository
- Clone your fork locally
- Create a new branch for your feature or bugfix
- Make your changes
- Test your changes
- Submit a pull request
- Python 3.11 or higher
- Home Assistant development environment
- Lark/Feishu developer account for testing
-
Clone the repository:
git clone https://github.com/calvinastroboy/ha-lark-integration.git cd ha-lark-integration -
Copy the integration to your Home Assistant config directory:
cp -r custom_components/lark /path/to/homeassistant/config/custom_components/
-
Restart Home Assistant
- Follow PEP 8 style guidelines
- Use type hints for all function parameters and return values
- Add docstrings to all classes and functions
- Keep functions small and focused on a single task
- Use meaningful variable and function names
Before submitting a pull request, ensure:
-
All Python files compile without errors:
python3 -m py_compile custom_components/lark/*.py -
All JSON files are valid:
python3 -c "import json; json.load(open('custom_components/lark/manifest.json'))" -
Test the integration in a real Home Assistant instance
-
Test all features:
- Configuration flow
- Sending text messages
- Sending images
- Sending interactive cards
- Receiving webhook messages
- Button callbacks
- Clear title: Use a descriptive title that summarizes the change
- Description: Explain what changes you made and why
- Testing: Describe how you tested your changes
- Breaking changes: Clearly mark any breaking changes
- Documentation: Update README.md if needed
Use clear, descriptive commit messages:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Examples:
feat: Add support for rich text messages
fix: Fix webhook verification for Lark events
docs: Update README with new examples
When reporting bugs, please include:
- Description: Clear description of the bug
- Steps to reproduce: Detailed steps to reproduce the issue
- Expected behavior: What you expected to happen
- Actual behavior: What actually happened
- Environment:
- Home Assistant version
- Integration version
- Python version
- Logs: Relevant error logs from Home Assistant
When suggesting new features:
- Use case: Explain why this feature would be useful
- Description: Detailed description of the feature
- Examples: Provide examples of how it would work
- Alternatives: Consider alternative solutions
We welcome translations! To add a new language:
- Copy
custom_components/lark/translations/en.json - Rename it to the appropriate language code (e.g.,
ja.jsonfor Japanese) - Translate all strings
- Submit a pull request
If you have questions about contributing, feel free to:
- Open an issue for discussion
- Check existing issues for similar questions
- Review closed pull requests for examples
Be respectful and constructive in all interactions. We aim to create a welcoming environment for all contributors.
By contributing, you agree that your contributions will be licensed under the MIT License.