Files
Jean-Marc Collin 22b2b965c1 Issue_766-enhance_power_management (#778)
* First implem + tests (not finished)

* With tests of calculate_shedding ok

* Commit for rebase

* All tests ok for central_feature_power_manager

* All tests not ok

* All tests ok

* integrattion tests - Do startup works

* enhance the overpowering algo if current_power > max_power

* Change shedding calculation delay to 20 sec (vs 60 sec)

* Integration tests ok

* Fix overpowering is set even if other heater have on_percent = 0

* Fix too much shedding in over_climate

* Add logs

* Add temporal filter for calculate_shedding
Add restore overpowering state at startup

* Fix restore overpowering_state

* Removes poweer_entity_id from vtherm non central config

* Release

* Add Sonoff TRVZB in creation.md

* Add comment on Sonoff TRVZB Closing degree

---------

Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
2025-01-05 18:10:18 +01:00
..
2022-12-28 17:25:25 +01:00

Developing with Visual Studio Code + devcontainer

The easiest way to get started with custom integration development is to use Visual Studio Code with devcontainers. This approach will create a preconfigured development environment with all the tools you need.

In the container you will have a dedicated Home Assistant core instance running with your custom component code. You can configure this instance by updating the ./devcontainer/configuration.yaml file.

Prerequisites

More info about requirements and devcontainer in general

Getting started:

  1. Fork the repository.
  2. Clone the repository to your computer.
  3. Open the repository using Visual Studio code.

When you open this repository with Visual Studio code you are asked to "Reopen in Container", this will start the build of the container.

If you don't see this notification, open the command palette and select Remote-Containers: Reopen Folder in Container.

Tasks

The devcontainer comes with some useful tasks to help you with development, you can start these tasks by opening the command palette and select Tasks: Run Task then select the task you want to run.

When a task is currently running (like Run Home Assistant on port 9123 for the docs), it can be restarted by opening the command palette and selecting Tasks: Restart Running Task, then select the task you want to restart.

The available tasks are:

Task Description
Run Home Assistant on port 9123 Launch Home Assistant with your custom component code and the configuration defined in .devcontainer/configuration.yaml.
Run Home Assistant configuration against /config Check the configuration.
Upgrade Home Assistant to latest dev Upgrade the Home Assistant core version in the container to the latest version of the dev branch.
Install a specific version of Home Assistant Install a specific version of Home Assistant core in the container.

Step by Step debugging

With the development container, you can test your custom component in Home Assistant with step by step debugging.

You need to modify the configuration.yaml file in .devcontainer folder by uncommenting the line:

# debugpy:

Then launch the task Run Home Assistant on port 9123, and launch the debbuger with the existing debugging configuration Python: Attach Local.

For more information, look at the Remote Python Debugger integration documentation.