From 41b13bec2b5e12b540e129807133fa89752da159 Mon Sep 17 00:00:00 2001 From: Krisjanis Lejejs Date: Fri, 9 Aug 2024 14:49:59 +0300 Subject: [PATCH] Improve development environment, bump requirements --- devcontainer.json => .devcontainer/devcontainer.json | 3 ++- requirements.txt | 2 +- scripts/update_ThermiaOnlineAPI_version.sh | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) rename devcontainer.json => .devcontainer/devcontainer.json (82%) diff --git a/devcontainer.json b/.devcontainer/devcontainer.json similarity index 82% rename from devcontainer.json rename to .devcontainer/devcontainer.json index 75b7aff..f9a20a2 100644 --- a/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,8 @@ "vscode": { "settings": { "python.pythonPath": "/usr/local/bin/python", - "python.formatting.provider": "black" + "python.formatting.provider": "black", + "editor.defaultFormatter": "ms-python.black-formatter" }, "extensions": [ "GitHub.copilot", diff --git a/requirements.txt b/requirements.txt index 0b7e81a..fe9683f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ homeassistant==2024.4.1 -ThermiaOnlineAPI==5.0.0 +ThermiaOnlineAPI==5.1.0 diff --git a/scripts/update_ThermiaOnlineAPI_version.sh b/scripts/update_ThermiaOnlineAPI_version.sh index a0d6916..580f628 100755 --- a/scripts/update_ThermiaOnlineAPI_version.sh +++ b/scripts/update_ThermiaOnlineAPI_version.sh @@ -2,6 +2,7 @@ set -e manifest_file="./custom_components/thermia/manifest.json" +requirements_file="./requirements.txt" latest_version_number=$(lastversion ThermiaOnlineAPI --at pip) latest_version=ThermiaOnlineAPI==$latest_version_number @@ -15,6 +16,10 @@ echo "Current version of ThermiaOnlineAPI: $current_version" if [ "$current_version" != "$latest_version" ]; then echo "Updating version to $latest_version" version=$latest_version jq ".requirements = [env.version]" $manifest_file > tmp.$$.json && mv tmp.$$.json $manifest_file + + # update requirements file to reflect correct version as well + cat $requirements_file | sed -E "s/$current_version/$latest_version/" > tmp.$$.txt && mv tmp.$$.txt $requirements_file + echo "ThermiaOnlineAPI version updated to $latest_version" echo "LATEST_API_VERSION=$latest_version_number" >> $GITHUB_ENV else