Skip to content

Commit

Permalink
[MERGE]
Browse files Browse the repository at this point in the history
  • Loading branch information
KartoffelToby committed Sep 19, 2023
1 parent efdb7f8 commit 524888d
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ template:


# If you need to debug uncomment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)
#debugpy:
debugpy:


13 changes: 9 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
{
"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
"name": "BETTER THERMOSTAT development",
"initializeCommand": "/bin/mkdir -p ${localWorkspaceFolder}/.haconfig && /bin/cp ${localWorkspaceFolder}/.devcontainer/configuration.yaml ${localWorkspaceFolder}/.haconfig",
"initializeCommand": "/bin/mkdir -p ${localWorkspaceFolder}/.haconfig && /bin/cp -n ${localWorkspaceFolder}/.devcontainer/configuration.yaml ${localWorkspaceFolder}/.haconfig",
"containerUser": "1000",
"remoteUser": "1000",
"appPort": [
"9123:8123"
],
"forwardPorts": [
9123
],
"portsAttributes": {
"8123": {
"9123": {
"label": "HomeAssistant port",
"protocol": "http",
"onAutoForward": "notify"
Expand Down Expand Up @@ -39,8 +44,8 @@
]
}
},
"postCreateCommand": "pip install -r requirements.dev.txt",
"postCreateCommand": "scripts/setup",
"mounts": [
"source=${localWorkspaceFolder}/.haconfig,target=/config,type=bind,consistency=cached"
]
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ venv
.idea
custom_components/hacs
x_*
.haconfig
.haconfig
8 changes: 5 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"request": "launch",
"module": "homeassistant",
"args": [
"--debug",
"-c",
"/config"
"/.haconfig"
],
"justMyCode": true
}
"justMyCode": false,
"console": "internalConsole"
},
]
}
10 changes: 5 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
{
"label": "Run Home Assistant on port 9123",
"type": "shell",
"command": "container start",
"command": "scripts/start",
"problemMatcher": []
},
{
"label": "Run Home Assistant configuration against /config",
"label": "Sync configuration.yaml (Override local)",
"type": "shell",
"command": "container check",
"command": "scripts/sync",
"problemMatcher": []
},
{
"label": "Upgrade Home Assistant to latest dev",
"type": "shell",
"command": "container install",
"command": "scripts/upgrade-dev",
"problemMatcher": []
},
{
"label": "Install a specific version of Home Assistant",
"type": "shell",
"command": "container set-version",
"command": "scripts/upgrade-version",
"problemMatcher": []
}
]
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@
The following is a set of guidelines for contributing to Better Thermostat. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this
document in a pull request.

## Development

#### Requirements
- VSCode
- Docker
- Devcontainer Extension

#### Setup
1. Clone the repository
2. Open the repository in VSCode
3. Click on the green button in the bottom left corner and select "Reopen in Container"
4. Wait for the container to build
5. Open Task Runner and run "Run Home Assistant on port 9123"
6. Open the browser and go to http://localhost:9123 -> Inital DEV HA Setup


#### Nice to know

- Debuging is possible with the VSCode Debuger. Just run the HomeAssistant in Debugger and open browser on http://localhost:9123 (No task run needed)
- Update your local in devcontainer configuration.yaml to the current version of the repository to get the latest changes. -> Run "Sync configuration.yaml (Override local)" in Task Runner
- Test BT in a specific HA version -> Run "Install a specific version of Home Assistant" in Task Runner and the the version you want to test in the terminal promt.
- Test BT with the latest HA version -> Run "pgrade Home Assistant to latest dev" in Task Runner

## How Can I Contribute?

## New Adapter
Expand Down
8 changes: 7 additions & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
homeassistant==2023.9.2
homeassistant==2023.9.2
pre-commit==2.15.0
black==23.9.1
codespell==2.2.2
ruff==0.0.289
yamllint==1.32.0
flake8==4.0.1

0 comments on commit 524888d

Please sign in to comment.