Skip to content

Latest commit

 

History

History
140 lines (102 loc) · 3.79 KB

File metadata and controls

140 lines (102 loc) · 3.79 KB

Contributing to Lark Integration

Thank you for your interest in contributing to the Lark Integration for Home Assistant! This document provides guidelines and instructions for contributing.

Getting Started

  1. Fork the repository
  2. Clone your fork locally
  3. Create a new branch for your feature or bugfix
  4. Make your changes
  5. Test your changes
  6. Submit a pull request

Development Setup

Prerequisites

  • Python 3.11 or higher
  • Home Assistant development environment
  • Lark/Feishu developer account for testing

Setting Up Development Environment

  1. Clone the repository:

    git clone https://github.com/calvinastroboy/ha-lark-integration.git
    cd ha-lark-integration
  2. Copy the integration to your Home Assistant config directory:

    cp -r custom_components/lark /path/to/homeassistant/config/custom_components/
  3. Restart Home Assistant

Code Style

  • 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

Testing

Before submitting a pull request, ensure:

  1. All Python files compile without errors:

    python3 -m py_compile custom_components/lark/*.py
  2. All JSON files are valid:

    python3 -c "import json; json.load(open('custom_components/lark/manifest.json'))"
  3. Test the integration in a real Home Assistant instance

  4. Test all features:

    • Configuration flow
    • Sending text messages
    • Sending images
    • Sending interactive cards
    • Receiving webhook messages
    • Button callbacks

Pull Request Guidelines

  1. Clear title: Use a descriptive title that summarizes the change
  2. Description: Explain what changes you made and why
  3. Testing: Describe how you tested your changes
  4. Breaking changes: Clearly mark any breaking changes
  5. Documentation: Update README.md if needed

Commit Message Guidelines

Use clear, descriptive commit messages:

  • feat: - New feature
  • fix: - Bug fix
  • docs: - Documentation changes
  • style: - Code style changes (formatting, etc.)
  • refactor: - Code refactoring
  • test: - Adding or updating tests
  • chore: - Maintenance tasks

Examples:

feat: Add support for rich text messages
fix: Fix webhook verification for Lark events
docs: Update README with new examples

Reporting Bugs

When reporting bugs, please include:

  1. Description: Clear description of the bug
  2. Steps to reproduce: Detailed steps to reproduce the issue
  3. Expected behavior: What you expected to happen
  4. Actual behavior: What actually happened
  5. Environment:
    • Home Assistant version
    • Integration version
    • Python version
  6. Logs: Relevant error logs from Home Assistant

Suggesting Features

When suggesting new features:

  1. Use case: Explain why this feature would be useful
  2. Description: Detailed description of the feature
  3. Examples: Provide examples of how it would work
  4. Alternatives: Consider alternative solutions

Translation

We welcome translations! To add a new language:

  1. Copy custom_components/lark/translations/en.json
  2. Rename it to the appropriate language code (e.g., ja.json for Japanese)
  3. Translate all strings
  4. Submit a pull request

Questions?

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

Code of Conduct

Be respectful and constructive in all interactions. We aim to create a welcoming environment for all contributors.

License

By contributing, you agree that your contributions will be licensed under the MIT License.