From c3a2526979e0a109ff6e50e2533c393648890757 Mon Sep 17 00:00:00 2001 From: bj00rn Date: Tue, 29 Oct 2024 21:50:28 +0100 Subject: [PATCH 1/7] add missing requirements.txt --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9b8320f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +colorlog==6.8.2 +homeassistant==2024.6.4 +pip>=21.3.1 From 852c6bca237021c490e5d0c109f585a9b82a8ae2 Mon Sep 17 00:00:00 2001 From: bj00rn Date: Tue, 29 Oct 2024 21:50:45 +0100 Subject: [PATCH 2/7] upgrade devcontainer from integration_blueprint --- .devcontainer/devcontainer.json | 52 ++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 01793e1..9f445e5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,31 +1,35 @@ // See https://aka.ms/vscode-remote/devcontainer.json for format details. { - "image": "ghcr.io/ludeeus/devcontainer/integration:stable", + "image": "mcr.microsoft.com/devcontainers/python:3.12", "name": "Nordpool integration development", - "context": "..", "appPort": [ "9123:8123" ], - "postCreateCommand": "container install", - "extensions": [ - "ms-python.python", - "github.vscode-pull-request-github", - "ryanluker.vscode-coverage-gutters", - "ms-python.vscode-pylance" - ], - "settings": { - "files.eol": "\n", - "editor.tabSize": 4, - "terminal.integrated.shell.linux": "/bin/bash", - "python.pythonPath": "/usr/bin/python3", - "python.analysis.autoSearchPaths": false, - "python.linting.pylintEnabled": true, - "python.linting.enabled": true, - "python.formatting.provider": "black", - "editor.formatOnPaste": false, - "editor.formatOnSave": true, - "editor.formatOnType": true, - "files.trimTrailingWhitespace": true - } - + "postCreateCommand": "scripts/setup", + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "github.vscode-pull-request-github", + "ryanluker.vscode-coverage-gutters", + "ms-python.vscode-pylance" + ], + "settings": { + "files.eol": "\n", + "editor.tabSize": 4, + "terminal.integrated.shell.linux": "/bin/bash", + "python.pythonPath": "/usr/bin/python3", + "python.analysis.autoSearchPaths": false, + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, + "python.formatting.provider": "black", + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "files.trimTrailingWhitespace": true + } + } + }, + "remoteUser": "vscode", + "features": {} } \ No newline at end of file From 89f2ae765c1ccfab334a3cc9bfe9a85c5806ebdd Mon Sep 17 00:00:00 2001 From: bj00rn Date: Tue, 29 Oct 2024 21:50:53 +0100 Subject: [PATCH 3/7] fix nordpool package not resolving correctly use mount instead of relying on PYTHONPATH to find integration --- .devcontainer/devcontainer.json | 7 +++++++ scripts/dev | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9f445e5..00a6505 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,6 +5,13 @@ "appPort": [ "9123:8123" ], + // Mount the path to custom_components + // This let's us have the structure we want /custom_components/integration_blueprint + // while at the same time have Home Assistant configuration inside /config + // without resulting to symlinks. + "mounts": [ + "source=${localWorkspaceFolder}/custom_components,target=${containerWorkspaceFolder}/config/custom_components,type=bind,consistency=cached" + ], "postCreateCommand": "scripts/setup", "customizations": { "vscode": { diff --git a/scripts/dev b/scripts/dev index 8174444..67f86c9 100644 --- a/scripts/dev +++ b/scripts/dev @@ -10,12 +10,6 @@ if [[ ! -d "${PWD}/config" ]]; then hass --config "${PWD}/config" --script ensure_config fi -# Set the path to custom_components -## This let's us have the structure we want /custom_components/integration_blueprint -## while at the same time have Home Assistant configuration inside /config -## without resulting to symlinks. -export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components" - echo $PWD # Start Home Assistant From 377fcfd34629a0efa724e1f63232fdaeb774e024 Mon Sep 17 00:00:00 2001 From: bj00rn Date: Tue, 29 Oct 2024 21:50:59 +0100 Subject: [PATCH 4/7] make script executable --- scripts/dev | 0 scripts/setup | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/dev mode change 100644 => 100755 scripts/setup diff --git a/scripts/dev b/scripts/dev old mode 100644 new mode 100755 diff --git a/scripts/setup b/scripts/setup old mode 100644 new mode 100755 From dd195377214d0d383187bdcc9264893f65468d1c Mon Sep 17 00:00:00 2001 From: bj00rn Date: Tue, 29 Oct 2024 21:51:02 +0100 Subject: [PATCH 5/7] move configuration to config dir as per integration_blueprint --- .gitignore | 4 ++++ {.devcontainer => config}/configuration.yaml | 0 2 files changed, 4 insertions(+) rename {.devcontainer => config}/configuration.yaml (100%) diff --git a/.gitignore b/.gitignore index af6d502..32c93c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# Home Assistant configuration +config/* +!config/configuration.yaml + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/.devcontainer/configuration.yaml b/config/configuration.yaml similarity index 100% rename from .devcontainer/configuration.yaml rename to config/configuration.yaml From 1a1a7ab74b55b6758c37760680dd12c0f5f64fe0 Mon Sep 17 00:00:00 2001 From: bj00rn Date: Tue, 29 Oct 2024 21:51:05 +0100 Subject: [PATCH 6/7] remove deprecated tasks --- .vscode/tasks.json | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 7ab4ba8..e8062f2 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,26 +4,8 @@ { "label": "Run Home Assistant on port 9123", "type": "shell", - "command": "container start", + "command": "scripts/dev", "problemMatcher": [] }, - { - "label": "Run Home Assistant configuration against /config", - "type": "shell", - "command": "container check", - "problemMatcher": [] - }, - { - "label": "Upgrade Home Assistant to latest dev", - "type": "shell", - "command": "container install", - "problemMatcher": [] - }, - { - "label": "Install a specific version of Home Assistant", - "type": "shell", - "command": "container set-version", - "problemMatcher": [] - } ] } \ No newline at end of file From 4df5055bb2136d6fef655f935c2aaeef89483334 Mon Sep 17 00:00:00 2001 From: bj00rn Date: Tue, 29 Oct 2024 21:51:09 +0100 Subject: [PATCH 7/7] add numpy dependency, seems to be required for onboarding --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 9b8320f..75e6d3f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ colorlog==6.8.2 homeassistant==2024.6.4 pip>=21.3.1 +numpy