Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions

Report Bugs

Report bugs at https://github.com/pcourbin/ecodevices_rt2/issues.

If you are reporting a bug, please include:

  • Your version of the custom_component and your configuration.

  • Any details about your local setup that might be helpful in troubleshooting.

  • Detailed steps to reproduce the bug.

Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it.

Implement Features

Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it.

Write Documentation

ecodevices_rt2 could always use more documentation, whether as part of the official pyecodevices_rt2 docs, in docstrings, or even on the web in blog posts, articles, and such.

Submit Feedback

The best way to send feedback is to file an issue at https://github.com/pcourbin/ecodevices_rt2/issues.

If you are proposing a feature:

  • Explain in detail how it would work.

  • Keep the scope as narrow as possible, to make it easier to implement.

  • Remember that this is a volunteer-driven project, and that contributions are welcome :)

AI / LLM Assistance

Code maintenance, bug fixes, refactoring, and tests in this repository now make use of AI/LLM coding tools, under the maintainer’s review and validated with pytest and ruff.

Get Started!

Ready to contribute? Here’s how to set up ecodevices_rt2 for local development.

  1. Fork the ecodevices_rt2 repo on GitHub.

  2. Clone your fork locally:

    $ git clone git@github.com:your_name_here/ecodevices_rt2.git
    
  3. Create a branch for local development:

    $ git checkout -b name-of-your-bugfix-or-feature
    

    Now you can make your changes locally.

  4. Choose your development / testing environment (Home Assistant 2026.11+ requires Python 3.14):

    Option A — Local Python 3.14 virtualenv (recommended for development, ``pytest`` and ``ruff``):

    $ python3.14 -m venv .venv
    $ source .venv/bin/activate
    $ pip install -r requirements_test.txt
    $ pre-commit install
    

    You can also start a local debug Home Assistant instance using config/ (copy config/secrets.yaml.example to config/secrets.yaml first):

    $ ./scripts/develop
    

    Option B — Official Home Assistant Docker container via Docker Compose (recommended for end-to-end testing with a real EcoDevices RT2):

    1. Initialize a local, gitignored test configuration directory from config/:

      $ cp -r config config_local
      $ cp config_local/secrets.yaml.example config_local/secrets.yaml
      
    2. Edit config_local/secrets.yaml with your real API key, then edit config_local/configuration.yaml to set your EcoDevices RT2 host, uncomment api_key: !secret rt2_api_key, and adapt the devices: list to your setup.

    3. Start Home Assistant (accessible at http://localhost:8123):

      $ docker compose -f docker-compose.test.yaml up
      

      (To use another config directory, run ``HA_CONFIG_DIR=/path/to/config docker compose -f docker-compose.test.yaml up``. After editing files in ``custom_components/ecodevices_rt2/``, run ``docker compose -f docker-compose.test.yaml restart``. Stop and remove the container with ``docker compose -f docker-compose.test.yaml down``.)

    Option C — `Visual Studio Code + devcontainer`_ (zero-config isolated environment):

    1. Open the repository using Visual Studio Code.

    2. When prompted, select “Reopen in Container” to build the Python 3.14 container and run scripts/setup.

    3. Run Home Assistant via Terminal > Run Task... > Run Home Assistant on port 8123.

  5. When you’re done making changes, check that your changes pass lint and tests:

    $ ./scripts/lint
    $ pytest
    $ make lint
    
  6. Commit your changes and push your branch to GitHub:

    $ git add .
    $ git commit -m "Your detailed description of your changes."
    $ git push origin name-of-your-bugfix-or-feature
    
  7. Submit a pull request through the GitHub website.

Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

  1. The pull request should include tests.

  2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.md.

Deploying

A reminder for the maintainers on how to release a new version:

  1. Update "version" in custom_components/ecodevices_rt2/manifest.json (also used by docs/conf.py).

  2. Add an entry in HISTORY.rst.

  3. Commit your changes, create a tag (vX.Y.Z) and push (or publish a GitHub Release):

    $ git add custom_components/ecodevices_rt2/manifest.json HISTORY.rst
    $ git commit -m "Bump version: X.Y.Z"
    $ git tag vX.Y.Z
    $ git push && git push --tags