Prepare and explain how to step by step debugging (#51)
This commit is contained in:
@ -41,3 +41,20 @@ Run Home Assistant on port 9123 | Launch Home Assistant with your custom compone
|
|||||||
Run Home Assistant configuration against /config | Check the configuration.
|
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.
|
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.
|
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:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# 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](https://www.home-assistant.io/integrations/debugpy/).
|
||||||
|
@ -4,3 +4,6 @@ logger:
|
|||||||
default: info
|
default: info
|
||||||
logs:
|
logs:
|
||||||
custom_components.integration_blueprint: debug
|
custom_components.integration_blueprint: debug
|
||||||
|
|
||||||
|
# If you need to debug uncommment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)
|
||||||
|
# debugpy:
|
||||||
|
35
.vscode/launch.json
vendored
Normal file
35
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
// Example of attaching to local debug server
|
||||||
|
"name": "Python: Attach Local",
|
||||||
|
"type": "python",
|
||||||
|
"request": "attach",
|
||||||
|
"port": 5678,
|
||||||
|
"host": "localhost",
|
||||||
|
"pathMappings": [
|
||||||
|
{
|
||||||
|
"localRoot": "${workspaceFolder}",
|
||||||
|
"remoteRoot": "."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Example of attaching to my production server
|
||||||
|
"name": "Python: Attach Remote",
|
||||||
|
"type": "python",
|
||||||
|
"request": "attach",
|
||||||
|
"port": 5678,
|
||||||
|
"host": "homeassistant.local",
|
||||||
|
"pathMappings": [
|
||||||
|
{
|
||||||
|
"localRoot": "${workspaceFolder}",
|
||||||
|
"remoteRoot": "/usr/src/homeassistant"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user