From bf7a05855f353b40f05bd28289839d83307712b0 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Sat, 30 Sep 2023 08:58:33 +0000 Subject: [PATCH 01/90] Update badge --- README_EXAMPLE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README_EXAMPLE.md b/README_EXAMPLE.md index 566d4dd..acaf6ae 100644 --- a/README_EXAMPLE.md +++ b/README_EXAMPLE.md @@ -4,12 +4,12 @@ [![GitHub Activity][commits-shield]][commits] [![License][license-shield]](LICENSE) -[![hacs][hacsbadge]][hacs] ![Project Maintenance][maintenance-shield] [![BuyMeCoffee][buymecoffeebadge]][buymecoffee] [![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum] +[![Open this repository in HACS][hacsbadge]][hacs_my] _Integration to integrate with [integration_blueprint][integration_blueprint]._ @@ -46,8 +46,8 @@ If you want to contribute to this please read the [Contribution guidelines](CONT [buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge [commits-shield]: https://img.shields.io/github/commit-activity/y/ludeeus/integration_blueprint.svg?style=for-the-badge [commits]: https://github.com/ludeeus/integration_blueprint/commits/main -[hacs]: https://github.com/hacs/integration -[hacsbadge]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge +[hacs_my]: https://my.home-assistant.io/redirect/hacs_repository/?owner=ludeeus&repository=integration_blueprint&category=integration +[hacsbadge]: https://my.home-assistant.io/badges/hacs_repository.svg [discord]: https://discord.gg/Qa5fW2R [discord-shield]: https://img.shields.io/discord/330944238910963714.svg?style=for-the-badge [exampleimg]: example.png From fbe0a5f99032faf0d8d5ec03d5e2e6d6d8142f8c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 12:34:36 +0000 Subject: [PATCH 02/90] Bump black from 23.1.0 to 23.9.1 Bumps [black](https://github.com/psf/black) from 23.1.0 to 23.9.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.1.0...23.9.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 18c39a4..e7ed9a3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ -r requirements-test.txt -black==23.1.0 +black==23.9.1 packaging==23.0 pre-commit~=3.0 PyGithub~=1.57 From fe7cec19289b43a64ce3e90492d764b3af14b015 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Sun, 1 Oct 2023 15:37:28 +0300 Subject: [PATCH 03/90] Fix test requirements --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 7dcb424..7724d65 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -6,5 +6,5 @@ mypy==1.0.0 pylint~=2.15 pylint-strict-informational==0.1 pytest>=7.2 -pytest-cov~=4.1 +pytest-cov>=3.0 pytest-homeassistant-custom-component>=0.12 From 5e1785a62ec3a47e52b8915ce89039cd5e489b31 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Sun, 1 Oct 2023 15:46:42 +0300 Subject: [PATCH 04/90] Fix py-dead-code workflow --- .github/workflows/py-dead-code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/py-dead-code.yml b/.github/workflows/py-dead-code.yml index db0609e..1453ec6 100644 --- a/.github/workflows/py-dead-code.yml +++ b/.github/workflows/py-dead-code.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v4 - run: | - echo "package=$(ls -F | grep \/$ | grep -v "bin\|examples\|tests" | sed -n "s/\///g;1p")" >> $GITHUB_ENV + echo "package=$(ls -F | grep \/$ | grep -v "scripts\|examples\|tests\|config" | sed -n "s/\///g;1p")" >> $GITHUB_ENV - name: "Set up Python" uses: actions/setup-python@v4 From a1459d68b96b223be0d6023b40adcc0f726ba3c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 12:48:26 +0000 Subject: [PATCH 05/90] Bump packaging from 23.0 to 23.1 Bumps [packaging](https://github.com/pypa/packaging) from 23.0 to 23.1. - [Release notes](https://github.com/pypa/packaging/releases) - [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pypa/packaging/compare/23.0...23.1) --- updated-dependencies: - dependency-name: packaging dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e7ed9a3..726f710 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ -r requirements-test.txt black==23.9.1 -packaging==23.0 +packaging==23.1 pre-commit~=3.0 PyGithub~=1.57 pyupgrade~=3.3 From 56425a3467f37df43644323ae8019c08c6105eb7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 12:53:26 +0000 Subject: [PATCH 06/90] Update pip requirement from <23.2,>=21.0 to >=21.0,<23.3 Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/pip/compare/21.0...23.2.1) --- updated-dependencies: - dependency-name: pip dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index add3d8e..94ee466 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ colorlog==6.7.0 homeassistant>=2023.1.0 -pip>=21.0,<23.2 +pip>=21.0,<23.3 ruff==0.0.267 From d4b66828f774f122aff60a4a229da8887cae1a63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 12:56:51 +0000 Subject: [PATCH 07/90] Update pyupgrade requirement from ~=3.3 to ~=3.13 Updates the requirements on [pyupgrade](https://github.com/asottile/pyupgrade) to permit the latest version. - [Commits](https://github.com/asottile/pyupgrade/compare/v3.3.0...v3.13.0) --- updated-dependencies: - dependency-name: pyupgrade dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 726f710..e308571 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,5 +3,5 @@ black==23.9.1 packaging==23.1 pre-commit~=3.0 PyGithub~=1.57 -pyupgrade~=3.3 +pyupgrade~=3.13 yamllint~=1.32 From 0e04ab1b8850b11f5eaa3e49a21c659fcfdc1722 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 12:57:15 +0000 Subject: [PATCH 08/90] Update pre-commit requirement from ~=3.0 to ~=3.4 Updates the requirements on [pre-commit](https://github.com/pre-commit/pre-commit) to permit the latest version. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.0.0...v3.4.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 726f710..04b6dbc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ -r requirements-test.txt black==23.9.1 packaging==23.1 -pre-commit~=3.0 +pre-commit~=3.4 PyGithub~=1.57 pyupgrade~=3.3 yamllint~=1.32 From c25227bb88331f0532eb0d917f87f25c4ca8e22f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 12:57:29 +0000 Subject: [PATCH 09/90] Bump mypy from 1.0.0 to 1.5.1 Bumps [mypy](https://github.com/python/mypy) from 1.0.0 to 1.5.1. - [Commits](https://github.com/python/mypy/compare/v1.0.0...v1.5.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 7724d65..4189d77 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,7 +2,7 @@ asynctest~=0.13 flake8~=6.1 flake8-docstrings~=1.7 -mypy==1.0.0 +mypy==1.5.1 pylint~=2.15 pylint-strict-informational==0.1 pytest>=7.2 From 8fd986bb29ebe14042564cfaf5b680ba2590794c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:03:44 +0000 Subject: [PATCH 10/90] Update pygithub requirement from ~=1.57 to ~=2.1 Updates the requirements on [pygithub](https://github.com/pygithub/pygithub) to permit the latest version. - [Release notes](https://github.com/pygithub/pygithub/releases) - [Changelog](https://github.com/PyGithub/PyGithub/blob/main/doc/changes.rst) - [Commits](https://github.com/pygithub/pygithub/compare/v1.57...v2.1.1) --- updated-dependencies: - dependency-name: pygithub dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1f04e55..a64d4cd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,6 +2,6 @@ black==23.9.1 packaging==23.1 pre-commit~=3.4 -PyGithub~=1.57 +PyGithub~=2.1 pyupgrade~=3.13 yamllint~=1.32 From 0ac8b77b25ad502aa4a3bc05714a9e2a329e15b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:04:09 +0000 Subject: [PATCH 11/90] Update pylint requirement from ~=2.15 to ~=2.17 Updates the requirements on [pylint](https://github.com/pylint-dev/pylint) to permit the latest version. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v2.15.0...v2.17.7) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 4189d77..6bf7cb4 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,7 +3,7 @@ asynctest~=0.13 flake8~=6.1 flake8-docstrings~=1.7 mypy==1.5.1 -pylint~=2.15 +pylint~=2.17 pylint-strict-informational==0.1 pytest>=7.2 pytest-cov>=3.0 From e22d0e052582ccfcecd2148723e4b690c139ab5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:04:25 +0000 Subject: [PATCH 12/90] Bump ruff from 0.0.267 to 0.0.291 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.267 to 0.0.291. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.0.267...v0.0.291) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 94ee466..069a338 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ colorlog==6.7.0 homeassistant>=2023.1.0 pip>=21.0,<23.3 -ruff==0.0.267 +ruff==0.0.291 From 96742e2c48552c7913ff373f7431c7991b9171a6 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Sun, 1 Oct 2023 18:52:51 +0300 Subject: [PATCH 13/90] Move bootstrap.sh to config directory --- .devcontainer/bootstrap.sh | 8 -------- scripts/devcontainer | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100755 .devcontainer/bootstrap.sh diff --git a/.devcontainer/bootstrap.sh b/.devcontainer/bootstrap.sh deleted file mode 100755 index 1b4c33a..0000000 --- a/.devcontainer/bootstrap.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -ROOT="$( cd "$( dirname "$(readlink -f "$0")" )/.." >/dev/null 2>&1 && pwd )" - -GITHUB_TOKEN=$(grep github_token ${ROOT}/secrets.yaml | cut -d' ' -f2) -FILES=$(grep "{GITHUB_TOKEN}" ${ROOT}/requirements.txt | sed "s/{GITHUB_TOKEN}/${GITHUB_TOKEN}/g" | tr "\r\n" " ") - -python3 -m pip install --upgrade ${FILES} diff --git a/scripts/devcontainer b/scripts/devcontainer index c7f7791..7f67c6b 100755 --- a/scripts/devcontainer +++ b/scripts/devcontainer @@ -72,9 +72,9 @@ docker_start() { } bootstrap() { - if test -f "${ROOT}/.devcontainer/bootstrap.sh"; then + if test -f "${ROOT}/config/bootstrap.sh"; then log.info "Execute bootstrap.sh..." - ${docker} exec -it -w "${workdir}" "${container}" .devcontainer/bootstrap.sh "$1" + ${docker} exec -it -w "${workdir}" "${container}" config/bootstrap.sh "$1" fi } From 8b2c72f0bf1101cd7a5b54cab60685766b26dd7a Mon Sep 17 00:00:00 2001 From: ludeeus Date: Sun, 1 Oct 2023 16:43:45 +0000 Subject: [PATCH 14/90] Remove my badge --- README_EXAMPLE.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README_EXAMPLE.md b/README_EXAMPLE.md index acaf6ae..e6fe2c5 100644 --- a/README_EXAMPLE.md +++ b/README_EXAMPLE.md @@ -9,7 +9,6 @@ [![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum] -[![Open this repository in HACS][hacsbadge]][hacs_my] _Integration to integrate with [integration_blueprint][integration_blueprint]._ @@ -46,8 +45,6 @@ If you want to contribute to this please read the [Contribution guidelines](CONT [buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge [commits-shield]: https://img.shields.io/github/commit-activity/y/ludeeus/integration_blueprint.svg?style=for-the-badge [commits]: https://github.com/ludeeus/integration_blueprint/commits/main -[hacs_my]: https://my.home-assistant.io/redirect/hacs_repository/?owner=ludeeus&repository=integration_blueprint&category=integration -[hacsbadge]: https://my.home-assistant.io/badges/hacs_repository.svg [discord]: https://discord.gg/Qa5fW2R [discord-shield]: https://img.shields.io/discord/330944238910963714.svg?style=for-the-badge [exampleimg]: example.png From bd2bb04e576dedd2ef66f636bbeae4a201bf85b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 14:58:41 +0000 Subject: [PATCH 15/90] Bump packaging from 23.1 to 23.2 Bumps [packaging](https://github.com/pypa/packaging) from 23.1 to 23.2. - [Release notes](https://github.com/pypa/packaging/releases) - [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pypa/packaging/compare/23.1...23.2) --- updated-dependencies: - dependency-name: packaging dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a64d4cd..96f98ef 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ -r requirements-test.txt black==23.9.1 -packaging==23.1 +packaging==23.2 pre-commit~=3.4 PyGithub~=2.1 pyupgrade~=3.13 From 13b2af8eae9839ec614e4140a9811886e0ec1d74 Mon Sep 17 00:00:00 2001 From: Anton Verburg <47820045+antonverburg@users.noreply.github.com> Date: Sun, 8 Oct 2023 17:24:12 +0200 Subject: [PATCH 16/90] Update .devcontainer.json: upgrade to python3.11 (#135) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should upgrade the dev container to python 3.11 (has been tested on my own PC, seems to work). This would fix https://github.com/ludeeus/integration_blueprint/issues/134 --------- Co-authored-by: Joakim Sørensen --- .devcontainer.json | 2 +- .github/workflows/lint.yml | 2 +- hacs.json | 4 ++-- requirements.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.devcontainer.json b/.devcontainer.json index 9fda616..c70f1f5 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,6 +1,6 @@ { "name": "ludeeus/integration_blueprint", - "image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye", + "image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye", "postCreateCommand": "scripts/setup", "forwardPorts": [ 8123 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 28f9fce..852226c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - name: "Set up Python" uses: actions/setup-python@v4.6.1 with: - python-version: "3.10" + python-version: "3.11" cache: "pip" - name: "Install requirements" diff --git a/hacs.json b/hacs.json index 65f7335..0c12f64 100644 --- a/hacs.json +++ b/hacs.json @@ -2,7 +2,7 @@ "name": "Integration blueprint", "filename": "integration_blueprint.zip", "hide_default_branch": true, - "homeassistant": "2023.3.0", + "homeassistant": "2023.8.0", "render_readme": true, "zip_release": true -} \ No newline at end of file +} diff --git a/requirements.txt b/requirements.txt index bb09464..ad6f856 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ colorlog==6.7.0 -homeassistant==2023.2.0 +homeassistant==2023.8.0 pip>=21.0,<23.2 ruff==0.0.267 From d33bba4d42e65526d813160f24b1a31708b15c3c Mon Sep 17 00:00:00 2001 From: Scott Giminiani Date: Sun, 8 Oct 2023 08:24:58 -0700 Subject: [PATCH 17/90] Minor grammatical fixes to bug.yml (#114) Made a few mostly minor grammatical fixes while adding this to my project. --- .github/ISSUE_TEMPLATE/bug.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 9c65fef..92fe7a5 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -9,7 +9,7 @@ body: - type: textarea attributes: label: "System Health details" - description: "Paste the data from the System Health card in Home Assistant (https://www.home-assistant.io//more-info/system-health#github-issues)" + description: "Paste the data from the System Health card in Home Assistant (https://www.home-assistant.io/more-info/system-health#github-issues)" validations: required: true - type: checkboxes @@ -22,7 +22,7 @@ body: required: true - label: This issue only contains 1 issue (if you have multiple issues, open one issue for each issue). required: true - - label: This issue is not a duplicate issue of currently [previous issues](https://github.com/ludeeus/integration_blueprint/issues?q=is%3Aissue+label%3A%22Bug%22+).. + - label: This issue is not a duplicate issue of any [previous issues](https://github.com/ludeeus/integration_blueprint/issues?q=is%3Aissue+label%3A%22Bug%22+).. required: true - type: textarea attributes: @@ -33,7 +33,7 @@ body: - type: textarea attributes: label: Reproduction steps - description: "Without steps to reproduce, it will be hard to fix, it is very important that you fill out this part, issues without it will be closed" + description: "Without steps to reproduce, it will be hard to fix. It is very important that you fill out this part. Issues without it will be closed." value: | 1. 2. From 1f650531d50b7b353dd5c4590cd7e8cfc991e083 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Oct 2023 17:35:24 +0200 Subject: [PATCH 18/90] Bump actions/checkout from 3.5.2 to 4.1.0 (#137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 4.0.0.
Release notes

Sourced from actions/checkout's releases.

v4.0.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3...v4.0.0

v3.6.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3.5.3...v3.6.0

v3.5.3

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3...v3.5.3

Changelog

Sourced from actions/checkout's changelog.

v4.0.0

v3.6.0

v3.5.3

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3.5.2&new-version=4.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joakim Sørensen --- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/validate.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 852226c..3d8cc90 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Checkout the repository" - uses: "actions/checkout@v3.5.2" + uses: "actions/checkout@v4.1.0" - name: "Set up Python" uses: actions/setup-python@v4.6.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2ac43a..5f27118 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: contents: write steps: - name: "Checkout the repository" - uses: "actions/checkout@v3.5.2" + uses: "actions/checkout@v4.1.0" - name: "Adjust version number" shell: "bash" diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 6d257aa..3f643d1 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,7 +17,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Checkout the repository" - uses: "actions/checkout@v3.5.2" + uses: "actions/checkout@v4.1.0" - name: "Run hassfest validation" uses: "home-assistant/actions/hassfest@master" @@ -27,7 +27,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Checkout the repository" - uses: "actions/checkout@v3.5.2" + uses: "actions/checkout@v4.1.0" - name: "Run HACS validation" uses: "hacs/action@main" From bd166b4eea3adc4310197e6d2a8c63b0495631ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Oct 2023 17:38:41 +0200 Subject: [PATCH 19/90] Bump actions/setup-python from 4.6.1 to 4.7.1 (#138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.6.1 to 4.7.1.
Release notes

Sourced from actions/setup-python's releases.

v4.7.1

What's Changed

Full Changelog: https://github.com/actions/setup-python/compare/v4...v4.7.1

v4.7.0

In scope of this release, the support for reading python version from pyproject.toml was added (actions/setup-python#669).

      - name: Setup Python
        uses: actions/setup-python@v4
        with:
          python-version-file: pyproject.toml

Besides, it includes such changes as:

New Contributors

Full Changelog: https://github.com/actions/setup-python/compare/v4...v4.7.0

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-python&package-manager=github_actions&previous-version=4.6.1&new-version=4.7.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3d8cc90..25bf6cc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: uses: "actions/checkout@v4.1.0" - name: "Set up Python" - uses: actions/setup-python@v4.6.1 + uses: actions/setup-python@v4.7.1 with: python-version: "3.11" cache: "pip" From 7a11f7b0837e7b069111d8903babe22bd69c1456 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Oct 2023 17:38:50 +0200 Subject: [PATCH 20/90] Bump ruff from 0.0.267 to 0.0.292 (#139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.267 to 0.0.292.
Release notes

Sourced from ruff's releases.

v0.0.292

What's Changed

Highlights

This release includes full support for Python 3.12 (out now!), including the new type parameter (PEP 695) and f-string syntaxes (PEP 701).

PEP 701 lifts many of the restrictions on f-strings that existed in the past, allowing for arbitrarily nested f-strings, consistent quote style within f-strings, and more, all of which are now supported by Ruff (thanks to @​dhruvmanila in astral-sh/ruff#7376).

Breaking Changes

  • In the formatter, format.quote-style no longer affects triple-quoted strings, to align with common conventions as well as the guidance from PEP 8 and PEP 257 (see: astral-sh/ruff#7680).
  • line-too-long (E501) now ignores trailing pragma comments (like # type: ignore and # noqa) when computing line length (see: astral-sh/ruff#7692). This is similar to flake8-bugbear's methodology for detecting overlong lines, and ensures that adding pragmas like # noqa does not introduce further lint errors.

Rules

Settings

Bug Fixes

... (truncated)

Changelog

Sourced from ruff's changelog.

Breaking Changes

0.0.288

Remove support for emoji identifiers (#7212)

Previously, Ruff supported the non-standard compliant emoji identifiers e.g. 📦 = 1. We decided to remove this non-standard language extension, and Ruff now reports syntax errors for emoji identifiers in your code, the same as CPython.

Improved GitLab fingerprints (#7203)

GitLab uses fingerprints to identify new, existing, or fixed violations. Previously, Ruff included the violation's position in the fingerprint. Using the location has the downside that changing any code before the violation causes the fingerprint to change, resulting in GitLab reporting one fixed and one new violation even though it is a pre-existing violation.

Ruff now uses a more stable location-agnostic fingerprint to minimize that existing violations incorrectly get marked as fixed and re-reported as new violations.

Expect GitLab to report each pre-existing violation in your project as fixed and a new violation in your Ruff upgrade PR.

0.0.283 / 0.284

The target Python version now defaults to 3.8 instead of 3.10 (#6397)

Previously, when a target Python version was not specified, Ruff would use a default of Python 3.10. However, it is safer to default to an older Python version to avoid assuming the availability of new features. We now default to the oldest supported Python version which is currently Python 3.8.

(We still support Python 3.7 but since it has reached EOL we've decided not to make it the default here.)

Note this change was announced in 0.0.283 but not active until 0.0.284.

0.0.277

.ipynb_checkpoints, .pyenv, .pytest_cache, and .vscode are now excluded by default (#5513)

Ruff maintains a list of default exclusions, which now consists of the following patterns:

  • .bzr
  • .direnv
  • .eggs
  • .git
  • .git-rewrite
  • .hg
  • .ipynb_checkpoints
  • .mypy_cache
  • .nox
  • .pants.d
  • .pyenv
  • .pytest_cache
  • .pytype
  • .ruff_cache
  • .svn
  • .tox
  • .venv

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ruff&package-manager=pip&previous-version=0.0.267&new-version=0.0.292)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ad6f856..96d2c84 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ colorlog==6.7.0 homeassistant==2023.8.0 pip>=21.0,<23.2 -ruff==0.0.267 +ruff==0.0.292 From 2a4719823815ffc5921618d54b2e9899df214c88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 14:04:42 +0000 Subject: [PATCH 21/90] Update pylint requirement from ~=2.17 to ~=3.0 Updates the requirements on [pylint](https://github.com/pylint-dev/pylint) to permit the latest version. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v2.17.0...v3.0.1) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 6bf7cb4..5f1081e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,7 +3,7 @@ asynctest~=0.13 flake8~=6.1 flake8-docstrings~=1.7 mypy==1.5.1 -pylint~=2.17 +pylint~=3.0 pylint-strict-informational==0.1 pytest>=7.2 pytest-cov>=3.0 From fa9d26a2f95dfacff1fa5311ee743782fdbfef44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:45:43 +0000 Subject: [PATCH 22/90] Bump ruff from 0.0.291 to 0.1.1 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.291 to 0.1.1. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.0.291...v0.1.1) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 069a338..580b053 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ colorlog==6.7.0 homeassistant>=2023.1.0 pip>=21.0,<23.3 -ruff==0.0.291 +ruff==0.1.1 From 46ccd1de1f8cd90fa203a23fff1d0b739b7d6111 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:49:51 +0000 Subject: [PATCH 23/90] Update pyupgrade requirement from ~=3.13 to ~=3.15 Updates the requirements on [pyupgrade](https://github.com/asottile/pyupgrade) to permit the latest version. - [Commits](https://github.com/asottile/pyupgrade/compare/v3.13.0...v3.15.0) --- updated-dependencies: - dependency-name: pyupgrade dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 96f98ef..38f27d8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,5 +3,5 @@ black==23.9.1 packaging==23.2 pre-commit~=3.4 PyGithub~=2.1 -pyupgrade~=3.13 +pyupgrade~=3.15 yamllint~=1.32 From c8f3a6dba982cbacdca61dd4e58b02bb66c527d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:49:59 +0000 Subject: [PATCH 24/90] Update pre-commit requirement from ~=3.4 to ~=3.5 Updates the requirements on [pre-commit](https://github.com/pre-commit/pre-commit) to permit the latest version. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.4.0...v3.5.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 96f98ef..b43ef39 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ -r requirements-test.txt black==23.9.1 packaging==23.2 -pre-commit~=3.4 +pre-commit~=3.5 PyGithub~=2.1 pyupgrade~=3.13 yamllint~=1.32 From 3fb088598eb52e485214578525abef0225989d07 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Mon, 6 Nov 2023 20:34:08 +0300 Subject: [PATCH 25/90] Add tzdata to test requirements --- requirements-test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-test.txt b/requirements-test.txt index 5f1081e..08cb07a 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -8,3 +8,4 @@ pylint-strict-informational==0.1 pytest>=7.2 pytest-cov>=3.0 pytest-homeassistant-custom-component>=0.12 +tzdata From 8c36290f23cf3bb799179848df05737d1025727c Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Mon, 6 Nov 2023 22:46:20 +0300 Subject: [PATCH 26/90] Fix .gitignore --- .gitignore | 1 + config/bootstrap.sh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100755 config/bootstrap.sh diff --git a/.gitignore b/.gitignore index b1d2583..85f2aa9 100644 --- a/.gitignore +++ b/.gitignore @@ -69,6 +69,7 @@ coverage.xml # Home Assistant configuration config/* +!config/bootstrap.sh !config/configuration.yaml diff --git a/config/bootstrap.sh b/config/bootstrap.sh new file mode 100755 index 0000000..1b4c33a --- /dev/null +++ b/config/bootstrap.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +ROOT="$( cd "$( dirname "$(readlink -f "$0")" )/.." >/dev/null 2>&1 && pwd )" + +GITHUB_TOKEN=$(grep github_token ${ROOT}/secrets.yaml | cut -d' ' -f2) +FILES=$(grep "{GITHUB_TOKEN}" ${ROOT}/requirements.txt | sed "s/{GITHUB_TOKEN}/${GITHUB_TOKEN}/g" | tr "\r\n" " ") + +python3 -m pip install --upgrade ${FILES} From 6ca32efec4f3c7dd5831a063e8cb8cdfb141612c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:36:01 +0000 Subject: [PATCH 27/90] Bump black from 23.9.1 to 23.11.0 Bumps [black](https://github.com/psf/black) from 23.9.1 to 23.11.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.9.1...23.11.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1e05453..cc186d4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ -r requirements-test.txt -black==23.9.1 +black==23.11.0 packaging==23.2 pre-commit~=3.5 PyGithub~=2.1 From 8dc884768e14e5ce3e3bf6a86ba62780a55d5106 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:36:08 +0000 Subject: [PATCH 28/90] Bump mypy from 1.5.1 to 1.7.0 Bumps [mypy](https://github.com/python/mypy) from 1.5.1 to 1.7.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.5.1...v1.7.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 08cb07a..4d251e8 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,7 +2,7 @@ asynctest~=0.13 flake8~=6.1 flake8-docstrings~=1.7 -mypy==1.5.1 +mypy==1.7.0 pylint~=3.0 pylint-strict-informational==0.1 pytest>=7.2 From 2cc75985aeec3b64086b3ad531e83a1b26f34549 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:36:16 +0000 Subject: [PATCH 29/90] Update yamllint requirement from ~=1.32 to ~=1.33 Updates the requirements on [yamllint](https://github.com/adrienverge/yamllint) to permit the latest version. - [Changelog](https://github.com/adrienverge/yamllint/blob/master/CHANGELOG.rst) - [Commits](https://github.com/adrienverge/yamllint/compare/v1.32.0...v1.33.0) --- updated-dependencies: - dependency-name: yamllint dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1e05453..033f82f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,4 +4,4 @@ packaging==23.2 pre-commit~=3.5 PyGithub~=2.1 pyupgrade~=3.15 -yamllint~=1.32 +yamllint~=1.33 From 3287e2cbf694f8f80b7bc01ba0ed35f54109121a Mon Sep 17 00:00:00 2001 From: myztillx Date: Fri, 17 Nov 2023 08:49:28 -0500 Subject: [PATCH 30/90] Bump to python 3.11 container --- .devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer.json b/.devcontainer.json index 9fda616..a4cc135 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,6 +1,6 @@ { "name": "ludeeus/integration_blueprint", - "image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye", + "image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11-bullseye", "postCreateCommand": "scripts/setup", "forwardPorts": [ 8123 From 8942798a173cd2b48785971b1b0a0c9477701f75 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:10:49 +0000 Subject: [PATCH 31/90] Bump dessant/lock-threads from 4 to 5 Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 4 to 5. - [Release notes](https://github.com/dessant/lock-threads/releases) - [Changelog](https://github.com/dessant/lock-threads/blob/main/CHANGELOG.md) - [Commits](https://github.com/dessant/lock-threads/compare/v4...v5) --- updated-dependencies: - dependency-name: dessant/lock-threads dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/issue-lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-lock.yml b/.github/workflows/issue-lock.yml index 5729d67..c03ded0 100644 --- a/.github/workflows/issue-lock.yml +++ b/.github/workflows/issue-lock.yml @@ -16,7 +16,7 @@ jobs: lock: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v4 + - uses: dessant/lock-threads@v5 with: github-token: ${{ github.token }} issue-lock-inactive-days: 30 From 84ebf42db002c44250897bf0be6c102dc324e3af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:15:17 +0000 Subject: [PATCH 32/90] Bump ruff from 0.1.1 to 0.1.6 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.1 to 0.1.6. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.1.1...v0.1.6) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 580b053..12f5fc2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ colorlog==6.7.0 homeassistant>=2023.1.0 pip>=21.0,<23.3 -ruff==0.1.1 +ruff==0.1.6 From e5dc4def71f12dd2cb5c31116c3640cc476a8b7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:18:08 +0000 Subject: [PATCH 33/90] Update pip requirement from <23.3,>=21.0 to >=21.0,<23.4 Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/pip/compare/21.0...23.3.1) --- updated-dependencies: - dependency-name: pip dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 12f5fc2..beb44f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ colorlog==6.7.0 homeassistant>=2023.1.0 -pip>=21.0,<23.3 +pip>=21.0,<23.4 ruff==0.1.6 From 5cfefe5e85fa8d2d62dee64e5f5d376bc057983d Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 21 Nov 2023 20:06:49 +0300 Subject: [PATCH 34/90] Update requirements --- custom_components/integration_blueprint/manifest.json | 5 +---- requirements-test.txt | 1 + requirements.txt | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/custom_components/integration_blueprint/manifest.json b/custom_components/integration_blueprint/manifest.json index 9c1ea12..778e651 100644 --- a/custom_components/integration_blueprint/manifest.json +++ b/custom_components/integration_blueprint/manifest.json @@ -9,9 +9,6 @@ "documentation": "https://github.com/Limych/ha-blueprint", "iot_class": "cloud_polling", "issue_tracker": "https://github.com/Limych/ha-blueprint/issues", - "requirements": [ - "colorlog==6.7.0", - "ruff==0.0.267" - ], + "requirements": [], "version": "0.1.0" } diff --git a/requirements-test.txt b/requirements-test.txt index 4d251e8..b4ce9f3 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -9,3 +9,4 @@ pytest>=7.2 pytest-cov>=3.0 pytest-homeassistant-custom-component>=0.12 tzdata +ruff~=0.1 diff --git a/requirements.txt b/requirements.txt index beb44f7..d67b052 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ -colorlog==6.7.0 homeassistant>=2023.1.0 pip>=21.0,<23.4 -ruff==0.1.6 From 813e74f3303ebf683ccd641ce2d12ed6040d2859 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 22 Nov 2023 00:08:39 +0300 Subject: [PATCH 35/90] Update devcontainer docker image --- scripts/devcontainer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/devcontainer b/scripts/devcontainer index 7f67c6b..35a6db5 100755 --- a/scripts/devcontainer +++ b/scripts/devcontainer @@ -16,7 +16,7 @@ workdir="/workspaces/${workspace}" container="dev-${workspace}" port="127.0.0.1:9123:8123" -image="ghcr.io/ludeeus/devcontainer/integration:stable" +image="python:3.11-slim-bookworm" volume="${ROOT}:${workdir}" cmd="menu" From 9f577c515511e04dc8314900173ab713dea1ec26 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 22 Nov 2023 04:14:25 +0300 Subject: [PATCH 36/90] Make local hosted devcontainer docker image --- .devcontainer/Dockerfile | 16 ++++++ .devcontainer/container/container | 3 ++ .devcontainer/container/container.mk | 12 +++++ .../common/homeassistant/check-config.sh | 3 ++ .../common/homeassistant/set-version.sh | 8 +++ .../helpers/common/homeassistant/start.sh | 40 +++++++++++++++ .../container/helpers/common/paths.sh | 9 ++++ .../container/helpers/integration/init.sh | 21 ++++++++ .../container/makefiles/integration.mk | 20 ++++++++ .devcontainer/install/cleanup.sh | 10 ++++ .devcontainer/install/container.sh | 24 +++++++++ .devcontainer/install/init.sh | 5 ++ .devcontainer/install/integration.sh | 50 +++++++++++++++++++ .github/ISSUE_TEMPLATE/bug.yml | 2 +- scripts/devcontainer | 3 +- 15 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/container/container create mode 100644 .devcontainer/container/container.mk create mode 100644 .devcontainer/container/helpers/common/homeassistant/check-config.sh create mode 100644 .devcontainer/container/helpers/common/homeassistant/set-version.sh create mode 100644 .devcontainer/container/helpers/common/homeassistant/start.sh create mode 100644 .devcontainer/container/helpers/common/paths.sh create mode 100644 .devcontainer/container/helpers/integration/init.sh create mode 100644 .devcontainer/container/makefiles/integration.mk create mode 100644 .devcontainer/install/cleanup.sh create mode 100644 .devcontainer/install/container.sh create mode 100644 .devcontainer/install/init.sh create mode 100644 .devcontainer/install/integration.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..7a53f74 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,16 @@ +ARG BUILD_FROM BUILD_FROM_TAG +FROM python:3.11-slim + +ENV DEVCONTAINER=true + +COPY ./container /container +COPY ./install /install + +ARG OS_VARIANT CONTAINER_TYPE +RUN \ + bash /install/init.sh \ + && bash /install/container.sh \ + && bash /install/integration.sh \ + && bash /install/cleanup.sh + +CMD ["bash"] diff --git a/.devcontainer/container/container b/.devcontainer/container/container new file mode 100644 index 0000000..e9c6237 --- /dev/null +++ b/.devcontainer/container/container @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +make --file /opt/container/container.mk "${*:-"help"}" diff --git a/.devcontainer/container/container.mk b/.devcontainer/container/container.mk new file mode 100644 index 0000000..78110c6 --- /dev/null +++ b/.devcontainer/container/container.mk @@ -0,0 +1,12 @@ +MAKEFLAGS += --no-print-directory +SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST))) +.DEFAULT_GOAL := help + +include /opt/container/makefiles/*.mk + +help: ## Show help + @printf " \033[1m%s\033[0m\n %s\033[32m\033[0m\n %s\033[32m\033[0m \n\n" "container" "Custom CLI used in this container" "https://github.com/ludeeus/container"; + @printf " \033[1m%s\033[0m\n %s\033[32m\033[0m \n\n" "usage:" "container [command]"; + @printf " \033[1m%s\033[0m\n" "where [command] is one of:"; + @awk 'BEGIN {FS = ":.*##";} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m container %-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST); + @echo diff --git a/.devcontainer/container/helpers/common/homeassistant/check-config.sh b/.devcontainer/container/helpers/common/homeassistant/check-config.sh new file mode 100644 index 0000000..de91bf3 --- /dev/null +++ b/.devcontainer/container/helpers/common/homeassistant/check-config.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +hass -c /config --script check_config \ No newline at end of file diff --git a/.devcontainer/container/helpers/common/homeassistant/set-version.sh b/.devcontainer/container/helpers/common/homeassistant/set-version.sh new file mode 100644 index 0000000..ade4e9e --- /dev/null +++ b/.devcontainer/container/helpers/common/homeassistant/set-version.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +read -p 'Set Home Assistant version: ' -r version +python3 -m pip --disable-pip-version-check install --upgrade homeassistant=="$version" + +if [[ -n "$POST_SET_VERSION_HOOK" ]]; then + "$POST_SET_VERSION_HOOK" "$version" +fi \ No newline at end of file diff --git a/.devcontainer/container/helpers/common/homeassistant/start.sh b/.devcontainer/container/helpers/common/homeassistant/start.sh new file mode 100644 index 0000000..8770e79 --- /dev/null +++ b/.devcontainer/container/helpers/common/homeassistant/start.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# shellcheck source=/dev/null + +source /opt/container/helpers/common/paths.sh +mkdir -p /config + +if test -f ".devcontainer/configuration.yaml"; then + echo "Copy configuration.yaml" + ln -sf "$(workspacePath).devcontainer/configuration.yaml" /config/configuration.yaml || echo ".devcontainer/configuration.yaml are missing" +fi + +if test -f ".devcontainer/ui-lovelace.yaml"; then + echo "Copy ui-lovelace.yaml" + ln -sf "$(workspacePath).devcontainer/ui-lovelace.yaml" /config/ui-lovelace.yaml || echo "" +fi + +if test -f ".devcontainer/secrets.yaml"; then + echo "Copy secrets.yaml" + ln -sf "$(workspacePath).devcontainer/secrets.yaml" /config/secrets.yaml || echo "" +fi + +if test -d "custom_components"; then + echo "Symlink the custom component directory" + + if test -d "custom_components"; then + rm -R /config/custom_components + fi + + ln -sf "$(workspacePath)custom_components/" /config/custom_components || echo "Could not copy the custom_component" exit 1 +elif test -f "__init__.py"; then + echo "Having the component in the root is currently not supported" +fi + +echo "Start Home Assistant" +if ! [ -x "$(command -v hass)" ]; then + echo "Home Assistant is not installed, running installation." + python3 -m pip --disable-pip-version-check install --upgrade git+https://github.com/home-assistant/home-assistant.git@dev +fi +hass --script ensure_config -c /config +hass -c /config diff --git a/.devcontainer/container/helpers/common/paths.sh b/.devcontainer/container/helpers/common/paths.sh new file mode 100644 index 0000000..d2ed67d --- /dev/null +++ b/.devcontainer/container/helpers/common/paths.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +function workspacePath { + if [[ -n "$WORKSPACE_DIRECTORY" ]]; then + echo "${WORKSPACE_DIRECTORY}/" + else + echo "$(find /workspaces -mindepth 1 -maxdepth 1 -type d | tail -1)/" + fi +} \ No newline at end of file diff --git a/.devcontainer/container/helpers/integration/init.sh b/.devcontainer/container/helpers/integration/init.sh new file mode 100644 index 0000000..754444e --- /dev/null +++ b/.devcontainer/container/helpers/integration/init.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# shellcheck source=/dev/null + +source /opt/container/helpers/common/paths.sh + + +if test -d "$(GetWorkspaceName).git"; then + echo ".git exsist in $(GetWorkspaceName), existing initializing" + exit 1 +fi + +echo "Initializing dev env for integration" +rm -R /tmp/init > /dev/null 2>&1 + +git clone https://github.com/custom-components/integration-blueprint.git /tmp/init + +rm -R /tmp/init/.git +rm -R /tmp/init/.devcontainer +cp -a /tmp/init/. "$(GetWorkspaceName)" +cd "$(GetWorkspaceName)" || exit 1 +git init \ No newline at end of file diff --git a/.devcontainer/container/makefiles/integration.mk b/.devcontainer/container/makefiles/integration.mk new file mode 100644 index 0000000..87fa68b --- /dev/null +++ b/.devcontainer/container/makefiles/integration.mk @@ -0,0 +1,20 @@ +start: ## Start Home Assistant with the integration loaded + @bash /opt/container/helpers/common/homeassistant/start.sh + +set-version: ## Set Home Assistant version + @bash /opt/container/helpers/common/homeassistant/set-version.sh + +install: ## Install Home Assistant dev in the container + @python3 -m pip --disable-pip-version-check install --upgrade git+https://github.com/home-assistant/home-assistant.git@dev + +upgrade: ## Upgrade Home Assistant to latest dev in the container + install + +run: + start + +check-config: ## Check Home Assistant config + @hass -c /config --script check_config + +init: ## Initialize the dev env + @bash /opt/container/helpers/integration/init.sh \ No newline at end of file diff --git a/.devcontainer/install/cleanup.sh b/.devcontainer/install/cleanup.sh new file mode 100644 index 0000000..f196398 --- /dev/null +++ b/.devcontainer/install/cleanup.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +echo -e "\\033[0;34mRunning cleanup script 'cleanup.sh'\\033[0m" + +apt-get clean -y +rm -fr /var/lib/apt/lists/* +rm -fr /tmp/* /var/{cache,log}/* + +rm -fr /container +rm -fr /install diff --git a/.devcontainer/install/container.sh b/.devcontainer/install/container.sh new file mode 100644 index 0000000..82122a7 --- /dev/null +++ b/.devcontainer/install/container.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -e +echo -e "\\033[0;34mRunning install script 'container.sh'\\033[0m" + +export DEBIAN_FRONTEND=noninteractive + +apt-get update +apt-get install -y --no-install-recommends \ + make + +mkdir -p /opt/container/makefiles +mkdir -p /opt/container/helpers +touch /opt/container/makefiles/dummy.mk + +cp /container/container.mk /opt/container/container.mk +cp -r /container/helpers/common /opt/container/helpers/common + +cp /container/container /usr/bin/container +chmod +x /usr/bin/container + +cp /container/makefiles/integration.mk /opt/container/makefiles/integration.mk +cp -r /container/helpers/integration /opt/container/helpers/integration + +container help diff --git a/.devcontainer/install/init.sh b/.devcontainer/install/init.sh new file mode 100644 index 0000000..e0c2704 --- /dev/null +++ b/.devcontainer/install/init.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +uname -m +printenv + diff --git a/.devcontainer/install/integration.sh b/.devcontainer/install/integration.sh new file mode 100644 index 0000000..d0b86d4 --- /dev/null +++ b/.devcontainer/install/integration.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +set -e +echo -e "\\033[0;34mRunning install script 'integration.sh'\\033[0m" + +export DEBIAN_FRONTEND=noninteractive + +apt-get update +apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + curl \ + ffmpeg \ + gcc \ + git \ + jq \ + libavcodec-dev \ + libavdevice-dev \ + libavfilter-dev \ + libavformat-dev \ + libavutil-dev \ + libbz2-dev \ + libcap-dev \ + libffi-dev \ + libjpeg-dev \ + liblzma-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libpcap-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + libswresample-dev \ + libswscale-dev \ + llvm \ + shellcheck \ + tar \ + tk-dev \ + wget \ + xz-utils \ + zlib1g-dev + + +mkdir -p /config/custom_components + +python3 -m pip --disable-pip-version-check install --upgrade \ + git+https://github.com/home-assistant/home-assistant.git@dev +python3 -m pip --disable-pip-version-check install --upgrade wheel setuptools + +# Fix issue https://github.com/home-assistant/core/issues/95192 +python3 -m pip --disable-pip-version-check install --upgrade git+https://github.com/boto/botocore urllib3~=1.26 diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 9c65fef..1de4f0f 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -44,7 +44,7 @@ body: - type: textarea attributes: label: "Debug logs" - description: "To enable debug logs check this https://www.home-assistant.io/integrations/logger/, this **needs** to include _everything_ from startup of Home Assistant to the point where you encounter the issue." + description: "To enable debug logs check this https://www.home-assistant.io/integrations/logger/, this **needs** to install _everything_ from startup of Home Assistant to the point where you encounter the issue." render: text validations: required: true diff --git a/scripts/devcontainer b/scripts/devcontainer index 35a6db5..b586313 100755 --- a/scripts/devcontainer +++ b/scripts/devcontainer @@ -16,7 +16,7 @@ workdir="/workspaces/${workspace}" container="dev-${workspace}" port="127.0.0.1:9123:8123" -image="python:3.11-slim-bookworm" +image="devcontainer" volume="${ROOT}:${workdir}" cmd="menu" @@ -80,6 +80,7 @@ bootstrap() { if ! ${docker} ps -a | grep -wq ${container} && [[ "${cmd}" != "down" ]]; then log.info "Create container..." + ${docker} build -t "${image}" "${ROOT}/.devcontainer/" ${docker} create -it --name "${container}" -p "${port}" -v "${volume}" "${image}" docker_start From 41b065c6ee3c5063202cac1bc65b0f8cf8cd6e64 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 22 Nov 2023 07:30:36 +0300 Subject: [PATCH 37/90] Update devcontainer --- .../helpers/common/homeassistant/start.sh | 16 ++++++++-------- .../container/helpers/integration/init.sh | 10 +++++----- .devcontainer/install/init.sh | 1 - .devcontainer/install/integration.sh | 3 --- config/bootstrap.sh | 2 +- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.devcontainer/container/helpers/common/homeassistant/start.sh b/.devcontainer/container/helpers/common/homeassistant/start.sh index 8770e79..080e956 100644 --- a/.devcontainer/container/helpers/common/homeassistant/start.sh +++ b/.devcontainer/container/helpers/common/homeassistant/start.sh @@ -4,25 +4,25 @@ source /opt/container/helpers/common/paths.sh mkdir -p /config -if test -f ".devcontainer/configuration.yaml"; then +if test -f "$(workspacePath)config/configuration.yaml"; then echo "Copy configuration.yaml" - ln -sf "$(workspacePath).devcontainer/configuration.yaml" /config/configuration.yaml || echo ".devcontainer/configuration.yaml are missing" + ln -sf "$(workspacePath)config/configuration.yaml" /config/configuration.yaml || echo "config/configuration.yaml are missing" fi -if test -f ".devcontainer/ui-lovelace.yaml"; then +if test -f "$(workspacePath)config/ui-lovelace.yaml"; then echo "Copy ui-lovelace.yaml" - ln -sf "$(workspacePath).devcontainer/ui-lovelace.yaml" /config/ui-lovelace.yaml || echo "" + ln -sf "$(workspacePath)config/ui-lovelace.yaml" /config/ui-lovelace.yaml || echo "" fi -if test -f ".devcontainer/secrets.yaml"; then +if test -f "$(workspacePath)config/secrets.yaml"; then echo "Copy secrets.yaml" - ln -sf "$(workspacePath).devcontainer/secrets.yaml" /config/secrets.yaml || echo "" + ln -sf "$(workspacePath)config/secrets.yaml" /config/secrets.yaml || echo "" fi -if test -d "custom_components"; then +if test -d "$(workspacePath)custom_components"; then echo "Symlink the custom component directory" - if test -d "custom_components"; then + if test -d "$(workspacePath)custom_components"; then rm -R /config/custom_components fi diff --git a/.devcontainer/container/helpers/integration/init.sh b/.devcontainer/container/helpers/integration/init.sh index 754444e..7118acb 100644 --- a/.devcontainer/container/helpers/integration/init.sh +++ b/.devcontainer/container/helpers/integration/init.sh @@ -4,8 +4,8 @@ source /opt/container/helpers/common/paths.sh -if test -d "$(GetWorkspaceName).git"; then - echo ".git exsist in $(GetWorkspaceName), existing initializing" +if test -d "$(workspacePath).git"; then + echo ".git exsist in $(workspacePath), existing initializing" exit 1 fi @@ -16,6 +16,6 @@ git clone https://github.com/custom-components/integration-blueprint.git /tmp/in rm -R /tmp/init/.git rm -R /tmp/init/.devcontainer -cp -a /tmp/init/. "$(GetWorkspaceName)" -cd "$(GetWorkspaceName)" || exit 1 -git init \ No newline at end of file +cp -a /tmp/init/. "$(workspacePath)" +cd "$(workspacePath)" || exit 1 +git init diff --git a/.devcontainer/install/init.sh b/.devcontainer/install/init.sh index e0c2704..868efb4 100644 --- a/.devcontainer/install/init.sh +++ b/.devcontainer/install/init.sh @@ -2,4 +2,3 @@ uname -m printenv - diff --git a/.devcontainer/install/integration.sh b/.devcontainer/install/integration.sh index d0b86d4..bb3fbb5 100644 --- a/.devcontainer/install/integration.sh +++ b/.devcontainer/install/integration.sh @@ -39,9 +39,6 @@ apt-get install -y --no-install-recommends \ xz-utils \ zlib1g-dev - -mkdir -p /config/custom_components - python3 -m pip --disable-pip-version-check install --upgrade \ git+https://github.com/home-assistant/home-assistant.git@dev python3 -m pip --disable-pip-version-check install --upgrade wheel setuptools diff --git a/config/bootstrap.sh b/config/bootstrap.sh index 1b4c33a..4b68a67 100755 --- a/config/bootstrap.sh +++ b/config/bootstrap.sh @@ -5,4 +5,4 @@ ROOT="$( cd "$( dirname "$(readlink -f "$0")" )/.." >/dev/null 2>&1 && pwd )" GITHUB_TOKEN=$(grep github_token ${ROOT}/secrets.yaml | cut -d' ' -f2) FILES=$(grep "{GITHUB_TOKEN}" ${ROOT}/requirements.txt | sed "s/{GITHUB_TOKEN}/${GITHUB_TOKEN}/g" | tr "\r\n" " ") -python3 -m pip install --upgrade ${FILES} +[ -z "${FILES}" ] || python3 -m pip install --upgrade ${FILES} From 76c75cacade01e1a9f4ce4d364da9d3813dd5ad2 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 22 Nov 2023 16:43:55 +0300 Subject: [PATCH 38/90] Update README_EXAMPLE.md --- README_EXAMPLE.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README_EXAMPLE.md b/README_EXAMPLE.md index 5e89a03..e0be8d4 100644 --- a/README_EXAMPLE.md +++ b/README_EXAMPLE.md @@ -31,7 +31,8 @@ Platform | Description ### Install from HACS (recommended) 1. Have [HACS][hacs] installed, this will allow you to easily manage and track updates. -1. Search for "Blueprint". +1. Search in HACS for "Blueprint" integration or just press the button below:\ +[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](hacs-repository) 1. Click Install below the found integration. 1. _If you want to configure component via Home Assistant UI..._\ in the HA UI go to "Configuration" > "Integrations" click "+" and search for "Integration blueprint". @@ -112,6 +113,7 @@ See separate [license file](LICENSE.md) for full text. [commits]: https://github.com/Limych/ha-blueprint/commits/master [hacs-shield]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=popout [hacs]: https://hacs.xyz +[hacs-repository]: https://my.home-assistant.io/redirect/hacs_repository/?owner=Limych&repository=ha-blueprint&category=integration [exampleimg]: example.png [forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=popout [forum]: https://community.home-assistant.io/ From fc41c246698ae81d9b50c4ef9d9776b7641f02b8 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 22 Nov 2023 16:47:57 +0300 Subject: [PATCH 39/90] Fix error in README_EXAMPLE.md --- README_EXAMPLE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_EXAMPLE.md b/README_EXAMPLE.md index e0be8d4..9cf37b6 100644 --- a/README_EXAMPLE.md +++ b/README_EXAMPLE.md @@ -32,7 +32,7 @@ Platform | Description 1. Have [HACS][hacs] installed, this will allow you to easily manage and track updates. 1. Search in HACS for "Blueprint" integration or just press the button below:\ -[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](hacs-repository) +[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)][hacs-repository] 1. Click Install below the found integration. 1. _If you want to configure component via Home Assistant UI..._\ in the HA UI go to "Configuration" > "Integrations" click "+" and search for "Integration blueprint". From 2d89ca6fdc8b73c03f6b4063a9eb043a0bbc890b Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 22 Nov 2023 20:18:33 +0300 Subject: [PATCH 40/90] Remove from tests Python 3.9 and add Python 3.12 --- .github/workflows/py-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/py-test.yml b/.github/workflows/py-test.yml index f6c3288..9122be6 100644 --- a/.github/workflows/py-test.yml +++ b/.github/workflows/py-test.yml @@ -66,7 +66,7 @@ jobs: strategy: max-parallel: 3 matrix: - python-version: ['3.9', '3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] steps: - name: "Checkout code" uses: actions/checkout@v4 From 744fd579f709badddd9bed072d6a2ef65686922d Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 22 Nov 2023 20:26:57 +0300 Subject: [PATCH 41/90] Make tests for Python 3.12 are experimental --- .github/workflows/py-test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/py-test.yml b/.github/workflows/py-test.yml index 9122be6..6928bf6 100644 --- a/.github/workflows/py-test.yml +++ b/.github/workflows/py-test.yml @@ -60,13 +60,18 @@ jobs: pylint ${{ env.package }} tests tests: - name: "Test package" + name: Test package on Python ${{ matrix.python-version }} needs: lint runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} strategy: max-parallel: 3 matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11'] + experimental: [false] + include: + - python-version: '3.12' + experimental: true steps: - name: "Checkout code" uses: actions/checkout@v4 From 66499a0c56b476acd291772e8ce5a82c5ce07b23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 14:42:54 +0000 Subject: [PATCH 42/90] Update pre-commit requirement from ~=3.5 to ~=3.6 Updates the requirements on [pre-commit](https://github.com/pre-commit/pre-commit) to permit the latest version. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.5.0...v3.6.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8ac7c09..44d4f3b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ -r requirements-test.txt black==23.11.0 packaging==23.2 -pre-commit~=3.5 +pre-commit~=3.6 PyGithub~=2.1 pyupgrade~=3.15 yamllint~=1.33 From e269d8b054e3d6cccaab9d6299b19825b76b33f8 Mon Sep 17 00:00:00 2001 From: misa1515 <61636045+misa1515@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:31:25 +0100 Subject: [PATCH 43/90] Create sk.json --- .../integration_blueprint/translations/sk.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 custom_components/integration_blueprint/translations/sk.json diff --git a/custom_components/integration_blueprint/translations/sk.json b/custom_components/integration_blueprint/translations/sk.json new file mode 100644 index 0000000..8448636 --- /dev/null +++ b/custom_components/integration_blueprint/translations/sk.json @@ -0,0 +1,18 @@ +{ + "config": { + "step": { + "user": { + "description": "Ak potrebujete pomoc s konfiguráciou, pozrite sa sem: https://github.com/ludeeus/integration_blueprint", + "data": { + "username": "Užívateľské meno", + "password": "Heslo" + } + } + }, + "error": { + "auth": "Používateľské meno/heslo je nesprávne.", + "connection": "Nedá sa pripojiť k serveru.", + "unknown": "Vyskytla sa neznáma chyba." + } + } +} From 4ac8156dfb87b024bbd3bfc8d078f64ec69b7a5b Mon Sep 17 00:00:00 2001 From: Rob van Oostenrijk Date: Mon, 15 Jan 2024 10:45:19 +0400 Subject: [PATCH 44/90] Updated constants --- custom_components/average/sensor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/custom_components/average/sensor.py b/custom_components/average/sensor.py index fac7c2f..32c086e 100644 --- a/custom_components/average/sensor.py +++ b/custom_components/average/sensor.py @@ -22,7 +22,7 @@ from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN from homeassistant.components.group import expand_entity_ids from homeassistant.components.recorder import get_instance, history -from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity +from homeassistant.components.sensor import SensorStateClass, SensorEntity from homeassistant.components.water_heater import DOMAIN as WATER_HEATER_DOMAIN from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN from homeassistant.const import ( @@ -32,10 +32,10 @@ CONF_ENTITIES, CONF_NAME, CONF_UNIQUE_ID, - DEVICE_CLASS_TEMPERATURE, EVENT_HOMEASSISTANT_START, STATE_UNAVAILABLE, STATE_UNKNOWN, + SensorDeviceClass ) from homeassistant.core import HomeAssistant, State, callback, split_entity_id from homeassistant.exceptions import TemplateError @@ -177,7 +177,7 @@ def __init__( self._attr_native_value = None self._attr_native_unit_of_measurement = None self._attr_icon = None - self._attr_state_class = STATE_CLASS_MEASUREMENT + self._attr_state_class = SensorStateClass.MEASUREMENT self._attr_device_class = None # self._attr_unique_id = ( @@ -409,13 +409,13 @@ def _init_mode(self, state: State): ATTR_UNIT_OF_MEASUREMENT ) self._temperature_mode = ( - self._attr_device_class == DEVICE_CLASS_TEMPERATURE + self._attr_device_class == SensorDeviceClass.TEMPERATURE or domain in (WEATHER_DOMAIN, CLIMATE_DOMAIN, WATER_HEATER_DOMAIN) or self._attr_native_unit_of_measurement in TEMPERATURE_UNITS ) if self._temperature_mode: _LOGGER.debug("%s is a temperature entity.", state.entity_id) - self._attr_device_class = DEVICE_CLASS_TEMPERATURE + self._attr_device_class = SensorDeviceClass.TEMPERATURE self._attr_native_unit_of_measurement = ( self.hass.config.units.temperature_unit ) From 66f817d207323cd61f4b5988da391058707db164 Mon Sep 17 00:00:00 2001 From: Rob van Oostenrijk Date: Mon, 15 Jan 2024 10:48:56 +0400 Subject: [PATCH 45/90] Update constants --- custom_components/average/sensor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_components/average/sensor.py b/custom_components/average/sensor.py index 32c086e..5aef544 100644 --- a/custom_components/average/sensor.py +++ b/custom_components/average/sensor.py @@ -22,7 +22,7 @@ from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN from homeassistant.components.group import expand_entity_ids from homeassistant.components.recorder import get_instance, history -from homeassistant.components.sensor import SensorStateClass, SensorEntity +from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass, SensorEntity from homeassistant.components.water_heater import DOMAIN as WATER_HEATER_DOMAIN from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN from homeassistant.const import ( @@ -34,8 +34,7 @@ CONF_UNIQUE_ID, EVENT_HOMEASSISTANT_START, STATE_UNAVAILABLE, - STATE_UNKNOWN, - SensorDeviceClass + STATE_UNKNOWN ) from homeassistant.core import HomeAssistant, State, callback, split_entity_id from homeassistant.exceptions import TemplateError From b509fb2e38c577ec4b17e71f45df92c4f7a0cb03 Mon Sep 17 00:00:00 2001 From: tompipe Date: Tue, 23 Jan 2024 11:38:36 +0000 Subject: [PATCH 46/90] Fix package name --- hacs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hacs.json b/hacs.json index 290a533..e6a6676 100644 --- a/hacs.json +++ b/hacs.json @@ -1,6 +1,6 @@ { "name": "Average Sensor", - "filename": "average_sensor.zip", + "filename": "average.zip", "hide_default_branch": true, "homeassistant": "2023.1.0", "render_readme": true, From 5073b8e55c3419da80d1924e32b5ed16cd649080 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Mon, 26 Feb 2024 23:22:08 +0300 Subject: [PATCH 47/90] Update blueprint update script --- scripts/update | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/update b/scripts/update index c012e41..312ec4e 100755 --- a/scripts/update +++ b/scripts/update @@ -9,8 +9,12 @@ cd "${ROOT}" if git branch -r | grep -q "blueprint/dev" ; then git fetch blueprint dev +elif git branch -r | grep -q "blueprint/develop" ; then + git fetch blueprint develop elif git branch -r | grep -q "blueprint/master" ; then git fetch blueprint master +elif git branch -r | grep -q "blueprint/main" ; then + git fetch blueprint main fi git fetch From fd8afc1390a0e22f816b74d464e05311f2c8f10f Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Mon, 26 Feb 2024 23:34:17 +0300 Subject: [PATCH 48/90] Update requirements --- custom_components/integration_blueprint/manifest.json | 10 +++++----- requirements-test.txt | 1 + requirements.txt | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/custom_components/integration_blueprint/manifest.json b/custom_components/integration_blueprint/manifest.json index 778e651..2825473 100644 --- a/custom_components/integration_blueprint/manifest.json +++ b/custom_components/integration_blueprint/manifest.json @@ -1,6 +1,6 @@ { - "domain": "integration_blueprint", - "name": "Integration blueprint", + "domain": "", + "name": "", "codeowners": [ "@Limych" ], @@ -8,7 +8,7 @@ "dependencies": [], "documentation": "https://github.com/Limych/ha-blueprint", "iot_class": "cloud_polling", - "issue_tracker": "https://github.com/Limych/ha-blueprint/issues", + "issue_tracker": "", "requirements": [], - "version": "0.1.0" -} + "version": "" +} \ No newline at end of file diff --git a/requirements-test.txt b/requirements-test.txt index b4ce9f3..576eab0 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,6 @@ -r requirements.txt asynctest~=0.13 +colorlog~=6.7 flake8~=6.1 flake8-docstrings~=1.7 mypy==1.7.0 diff --git a/requirements.txt b/requirements.txt index 2a9b121..a89241a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ -colorlog==6.7.0 homeassistant>=2023.8.0 pip>=21.0,<23.2 -ruff==0.0.292 From f6cb1ac3a147ccf106fc20353a5efe822710988b Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Mon, 26 Feb 2024 23:39:26 +0300 Subject: [PATCH 49/90] Update Python versions for testing workflow --- .github/workflows/py-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/py-test.yml b/.github/workflows/py-test.yml index 6928bf6..bc1af6e 100644 --- a/.github/workflows/py-test.yml +++ b/.github/workflows/py-test.yml @@ -67,11 +67,11 @@ jobs: strategy: max-parallel: 3 matrix: - python-version: ['3.10', '3.11'] + python-version: ['3.11', '3.12'] experimental: [false] - include: - - python-version: '3.12' - experimental: true +# include: +# - python-version: '3.12' +# experimental: true steps: - name: "Checkout code" uses: actions/checkout@v4 From 02c8e134a0a3e689f48f8653d971fc955902796f Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Mon, 26 Feb 2024 23:53:26 +0300 Subject: [PATCH 50/90] Update requirements --- custom_components/integration_blueprint/manifest.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/integration_blueprint/manifest.json b/custom_components/integration_blueprint/manifest.json index 2825473..ff51972 100644 --- a/custom_components/integration_blueprint/manifest.json +++ b/custom_components/integration_blueprint/manifest.json @@ -9,6 +9,8 @@ "documentation": "https://github.com/Limych/ha-blueprint", "iot_class": "cloud_polling", "issue_tracker": "", - "requirements": [], + "requirements": [ + "async-timeout" + ], "version": "" } \ No newline at end of file From eaabfeaa2ff4d34c5122d0d8bad7669efc4f94f4 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 00:10:48 +0300 Subject: [PATCH 51/90] Update requirements --- custom_components/integration_blueprint/manifest.json | 4 +--- requirements-test.txt | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_components/integration_blueprint/manifest.json b/custom_components/integration_blueprint/manifest.json index ff51972..2825473 100644 --- a/custom_components/integration_blueprint/manifest.json +++ b/custom_components/integration_blueprint/manifest.json @@ -9,8 +9,6 @@ "documentation": "https://github.com/Limych/ha-blueprint", "iot_class": "cloud_polling", "issue_tracker": "", - "requirements": [ - "async-timeout" - ], + "requirements": [], "version": "" } \ No newline at end of file diff --git a/requirements-test.txt b/requirements-test.txt index 576eab0..479ef42 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,5 @@ -r requirements.txt +async-timeout asynctest~=0.13 colorlog~=6.7 flake8~=6.1 From 5489d6466775770b9bcc5ce6921f410d742dd9af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:14:29 +0000 Subject: [PATCH 52/90] Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/lint.yml | 2 +- .github/workflows/py-dead-code.yml | 2 +- .github/workflows/py-test.yml | 4 ++-- .github/workflows/release.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 25bf6cc..091336c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: uses: "actions/checkout@v4.1.0" - name: "Set up Python" - uses: actions/setup-python@v4.7.1 + uses: actions/setup-python@v5 with: python-version: "3.11" cache: "pip" diff --git a/.github/workflows/py-dead-code.yml b/.github/workflows/py-dead-code.yml index 1453ec6..87cad47 100644 --- a/.github/workflows/py-dead-code.yml +++ b/.github/workflows/py-dead-code.yml @@ -15,7 +15,7 @@ jobs: echo "package=$(ls -F | grep \/$ | grep -v "scripts\|examples\|tests\|config" | sed -n "s/\///g;1p")" >> $GITHUB_ENV - name: "Set up Python" - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/py-test.yml b/.github/workflows/py-test.yml index bc1af6e..bf31ef0 100644 --- a/.github/workflows/py-test.yml +++ b/.github/workflows/py-test.yml @@ -23,7 +23,7 @@ jobs: echo "package=$(ls -F | grep \/$ | grep -v "bin\|examples\|tests" | sed -n "s/\///g;1p")" >> $GITHUB_ENV - name: "Set up Python" - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' @@ -77,7 +77,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e5177d..2ab2ea0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ jobs: - name: "Set up Python" if: env.release_version != '' && success() - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.9 From 91df910b8f069d4d4f56bacbba7ed940da7ea646 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:15:27 +0000 Subject: [PATCH 53/90] Bump black from 23.11.0 to 24.2.0 Bumps [black](https://github.com/psf/black) from 23.11.0 to 24.2.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.11.0...24.2.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8ac7c09..fba84bb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ -r requirements-test.txt -black==23.11.0 +black==24.2.0 packaging==23.2 pre-commit~=3.5 PyGithub~=2.1 From 360a46537e326b191e4bac24e6d8458b9f87c52e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:15:31 +0000 Subject: [PATCH 54/90] Update flake8 requirement from ~=6.1 to ~=7.0 Updates the requirements on [flake8](https://github.com/pycqa/flake8) to permit the latest version. - [Commits](https://github.com/pycqa/flake8/compare/6.1.0...7.0.0) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 479ef42..abbda82 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,7 +2,7 @@ async-timeout asynctest~=0.13 colorlog~=6.7 -flake8~=6.1 +flake8~=7.0 flake8-docstrings~=1.7 mypy==1.7.0 pylint~=3.0 From 5a75952b3a556ba9c57be936e25029c64ceb954a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:15:35 +0000 Subject: [PATCH 55/90] Update pygithub requirement from ~=2.1 to ~=2.2 Updates the requirements on [pygithub](https://github.com/pygithub/pygithub) to permit the latest version. - [Release notes](https://github.com/pygithub/pygithub/releases) - [Changelog](https://github.com/PyGithub/PyGithub/blob/main/doc/changes.rst) - [Commits](https://github.com/pygithub/pygithub/compare/v2.1.0...v2.2.0) --- updated-dependencies: - dependency-name: pygithub dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 8ac7c09..d64162e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,6 +2,6 @@ black==23.11.0 packaging==23.2 pre-commit~=3.5 -PyGithub~=2.1 +PyGithub~=2.2 pyupgrade~=3.15 yamllint~=1.33 From 12263bae3653d81844eeb7e9ad1279fc7e345393 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:15:37 +0000 Subject: [PATCH 56/90] Bump actions/cache from 3 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/py-dead-code.yml | 2 +- .github/workflows/py-test.yml | 4 ++-- .github/workflows/release.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/py-dead-code.yml b/.github/workflows/py-dead-code.yml index 1453ec6..187b800 100644 --- a/.github/workflows/py-dead-code.yml +++ b/.github/workflows/py-dead-code.yml @@ -20,7 +20,7 @@ jobs: python-version: '3.9' - name: "Cache pip" - uses: actions/cache@v3 + uses: actions/cache@v4 with: # This path is specific to Ubuntu path: ~/.cache/pip diff --git a/.github/workflows/py-test.yml b/.github/workflows/py-test.yml index bc1af6e..9a38bd7 100644 --- a/.github/workflows/py-test.yml +++ b/.github/workflows/py-test.yml @@ -28,7 +28,7 @@ jobs: python-version: '3.11' - name: "Cache pip" - uses: actions/cache@v3 + uses: actions/cache@v4 with: # This path is specific to Ubuntu path: ~/.cache/pip @@ -82,7 +82,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: "Cache pip" - uses: actions/cache@v3 + uses: actions/cache@v4 with: # This path is specific to Ubuntu path: ~/.cache/pip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e5177d..44526f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: - name: "Cache pip" if: env.release_version != '' && success() - uses: actions/cache@v3 + uses: actions/cache@v4 with: # This path is specific to Ubuntu path: ~/.cache/pip From 5f2f02645d40e7b23e2673f24f813c164aac9165 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:16:02 +0000 Subject: [PATCH 57/90] Bump mypy from 1.7.0 to 1.8.0 Bumps [mypy](https://github.com/python/mypy) from 1.7.0 to 1.8.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.7.0...v1.8.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 479ef42..d1106fe 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -4,7 +4,7 @@ asynctest~=0.13 colorlog~=6.7 flake8~=6.1 flake8-docstrings~=1.7 -mypy==1.7.0 +mypy==1.8.0 pylint~=3.0 pylint-strict-informational==0.1 pytest>=7.2 From 509138de6bbaabca095bb52e888d7a07c8ff5785 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:16:13 +0000 Subject: [PATCH 58/90] Bump github/codeql-action from 2 to 3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 03c8954..60e04b6 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,7 +42,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -56,7 +56,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -69,4 +69,4 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From e91a15d5ff0918a038a6d8bc2eb662bafe830e07 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 00:17:57 +0300 Subject: [PATCH 59/90] Update find dead code workflow --- .github/workflows/py-dead-code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/py-dead-code.yml b/.github/workflows/py-dead-code.yml index 1453ec6..5b0f564 100644 --- a/.github/workflows/py-dead-code.yml +++ b/.github/workflows/py-dead-code.yml @@ -17,7 +17,7 @@ jobs: - name: "Set up Python" uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.11' - name: "Cache pip" uses: actions/cache@v3 From 2b2b7d8d21783b02c4cf9da10fc5c3e3a1ba4725 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 00:39:49 +0300 Subject: [PATCH 60/90] Update update_manifest script --- custom_components/integration_blueprint/manifest.json | 6 +++--- hacs.json | 2 +- scripts/update_manifest | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/custom_components/integration_blueprint/manifest.json b/custom_components/integration_blueprint/manifest.json index 2825473..e1b321a 100644 --- a/custom_components/integration_blueprint/manifest.json +++ b/custom_components/integration_blueprint/manifest.json @@ -1,6 +1,6 @@ { - "domain": "", - "name": "", + "domain": "integration_blueprint", + "name": "Integration blueprint", "codeowners": [ "@Limych" ], @@ -10,5 +10,5 @@ "iot_class": "cloud_polling", "issue_tracker": "", "requirements": [], - "version": "" + "version": "0.0.0" } \ No newline at end of file diff --git a/hacs.json b/hacs.json index 8065dce..0c12f64 100644 --- a/hacs.json +++ b/hacs.json @@ -1,5 +1,5 @@ { - "name": "", + "name": "Integration blueprint", "filename": "integration_blueprint.zip", "hide_default_branch": true, "homeassistant": "2023.8.0", diff --git a/scripts/update_manifest b/scripts/update_manifest index 52ffeca..b603647 100755 --- a/scripts/update_manifest +++ b/scripts/update_manifest @@ -18,11 +18,11 @@ component=$(ls -q "${ROOT}/custom_components/" | grep -v __ | head -n 1) const_path="custom_components/${component}/const.py" reqs_path="requirements.txt" -name=$(grep "^NAME: Final =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") -domain=$(grep "^DOMAIN: Final =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") -version=$(grep "^VERSION: Final =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") -issue_url=$(grep "^ISSUE_URL: Final =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") -ha_version=$(grep "^homeassistant>=" ${reqs_path} | sed -E "s/^[^=]+=(\S*).*$/\\1/") +name=$(grep -Ei "^NAME(: Final)? =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") +domain=$(grep -Ei "^DOMAIN(: Final)? =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") +version=$(grep -Ei "^VERSION(: Final)? =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") +issue_url=$(grep -Ei "^ISSUE_URL(: Final)? =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") +ha_version=$(grep -Ei "^homeassistant>=" ${reqs_path} | sed -E "s/^[^=]+=(\S*).*$/\\1/") log.info "Update manifest.json data..." manifest_path="custom_components/${component}/manifest.json" From fd50121d43ebd8c704b7943a903a8f585de0b47b Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 00:43:41 +0300 Subject: [PATCH 61/90] Update blueprint integration const.py --- custom_components/integration_blueprint/const.py | 1 + custom_components/integration_blueprint/manifest.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/integration_blueprint/const.py b/custom_components/integration_blueprint/const.py index 66c28f3..ec9da8f 100644 --- a/custom_components/integration_blueprint/const.py +++ b/custom_components/integration_blueprint/const.py @@ -7,3 +7,4 @@ DOMAIN = "integration_blueprint" VERSION = "0.0.0" ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/" +ISSUE_URL = "https://github.com/Limych/ha-blueprint/issues" diff --git a/custom_components/integration_blueprint/manifest.json b/custom_components/integration_blueprint/manifest.json index e1b321a..14be6b4 100644 --- a/custom_components/integration_blueprint/manifest.json +++ b/custom_components/integration_blueprint/manifest.json @@ -8,7 +8,7 @@ "dependencies": [], "documentation": "https://github.com/Limych/ha-blueprint", "iot_class": "cloud_polling", - "issue_tracker": "", + "issue_tracker": "https://github.com/Limych/ha-blueprint/issues", "requirements": [], "version": "0.0.0" } \ No newline at end of file From 06bc9eb7f259f3c9b0967bcd3fa788a1edfb698f Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 01:26:17 +0300 Subject: [PATCH 62/90] Update release workflow --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2c3f77..f620576 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: if: env.release_version != '' && success() uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: '3.11' - name: "Cache pip" if: env.release_version != '' && success() From 5ba9115040af1969867979907a8a8e694accb4a7 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 18:58:23 +0300 Subject: [PATCH 63/90] Update readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4eebd04..866a35a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,8 @@ I also suggest you [visit the support topic][forum] on the community forum. ### Install from HACS (recommended) 1. Have [HACS][hacs] installed, this will allow you to easily manage and track updates. -1. Search for "Average". +1. Search in HACS for "Average" integration or just press the button below:\ +[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)][hacs-repository] 1. Click Install below the found integration. ... then if you want to use `configuration.yaml` to configure sensor... @@ -340,6 +341,7 @@ See separate [license file](LICENSE.md) for full text. [commits]: https://github.com/Limych/ha-average/commits/dev [hacs-shield]: https://img.shields.io/badge/HACS-Default-orange.svg?style=popout [hacs]: https://hacs.xyz +[hacs-repository]: https://my.home-assistant.io/redirect/hacs_repository/?owner=Limych&repository=ha-average&category=integration [exampleimg]: https://github.com/Limych/ha-average/raw/dev/example.png [forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=popout [forum]: https://community.home-assistant.io/t/average-sensor/111674 From aebd2907ad13774e508748e64a178623811340f9 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 18:59:14 +0300 Subject: [PATCH 64/90] Bump version to 2.3.2 --- custom_components/average/const.py | 2 +- custom_components/average/manifest.json | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/custom_components/average/const.py b/custom_components/average/const.py index 2de6027..989adec 100644 --- a/custom_components/average/const.py +++ b/custom_components/average/const.py @@ -12,7 +12,7 @@ NAME: Final = "Average Sensor" DOMAIN: Final = "average" -VERSION: Final = "2.3.2-alpha" +VERSION: Final = "2.3.2" ISSUE_URL: Final = "https://github.com/Limych/ha-average/issues" STARTUP_MESSAGE: Final = f""" diff --git a/custom_components/average/manifest.json b/custom_components/average/manifest.json index 75dca89..4a81409 100644 --- a/custom_components/average/manifest.json +++ b/custom_components/average/manifest.json @@ -14,8 +14,6 @@ "documentation": "https://github.com/Limych/ha-average", "iot_class": "calculated", "issue_tracker": "https://github.com/Limych/ha-average/issues", - "requirements": [ - "colorlog==6.7.0" - ], - "version": "2.3.2-alpha" + "requirements": [], + "version": "2.3.2" } \ No newline at end of file From 7bcdbdde2cdd5ca7c5be71a6d6a3d9a695c42abc Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 19:05:45 +0300 Subject: [PATCH 65/90] Remove deprecated constants --- tests/test_sensor.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/test_sensor.py b/tests/test_sensor.py index 0ef4ebe..f8aa9f4 100644 --- a/tests/test_sensor.py +++ b/tests/test_sensor.py @@ -19,7 +19,7 @@ check_period_keys, ) from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN -from homeassistant.components.sensor import DOMAIN as SENSOR +from homeassistant.components.sensor import DOMAIN as SENSOR, SensorDeviceClass from homeassistant.components.water_heater import DOMAIN as WATER_HEATER_DOMAIN from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN from homeassistant.const import ( @@ -29,10 +29,9 @@ CONF_ENTITIES, CONF_NAME, CONF_PLATFORM, - DEVICE_CLASS_TEMPERATURE, STATE_UNAVAILABLE, STATE_UNKNOWN, - TEMP_FAHRENHEIT, + UnitOfTemperature, ) from homeassistant.core import HomeAssistant, State from homeassistant.helpers.template import Template @@ -244,7 +243,7 @@ async def test__get_temperature(default_sensor): state = State( "sensor.test", "125", - {ATTR_UNIT_OF_MEASUREMENT: TEMP_FAHRENHEIT}, + {ATTR_UNIT_OF_MEASUREMENT: UnitOfTemperature.FAHRENHEIT}, dt_util.now(), ) assert round(default_sensor._get_temperature(state), 3) == 51.667 @@ -252,7 +251,7 @@ async def test__get_temperature(default_sensor): state = State( "sensor.test", "", - {ATTR_UNIT_OF_MEASUREMENT: TEMP_FAHRENHEIT}, + {ATTR_UNIT_OF_MEASUREMENT: UnitOfTemperature.FAHRENHEIT}, dt_util.now(), ) assert default_sensor._get_temperature(state) is None @@ -260,7 +259,7 @@ async def test__get_temperature(default_sensor): state = State( "sensor.test", "qwe", - {ATTR_UNIT_OF_MEASUREMENT: TEMP_FAHRENHEIT}, + {ATTR_UNIT_OF_MEASUREMENT: UnitOfTemperature.FAHRENHEIT}, dt_util.now(), ) assert default_sensor._get_temperature(state) is None @@ -321,7 +320,7 @@ async def test__init_mode(hass: HomeAssistant, default_sensor, caplog): "sensor.test", "None", { - ATTR_DEVICE_CLASS: DEVICE_CLASS_TEMPERATURE, + ATTR_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, }, ) @@ -333,7 +332,7 @@ async def test__init_mode(hass: HomeAssistant, default_sensor, caplog): default_sensor._init_mode(state) assert default_sensor._temperature_mode is True - assert default_sensor._attr_device_class is DEVICE_CLASS_TEMPERATURE + assert default_sensor._attr_device_class is SensorDeviceClass.TEMPERATURE assert ( default_sensor._attr_native_unit_of_measurement is hass.config.units.temperature_unit @@ -358,7 +357,7 @@ async def test__init_mode(hass: HomeAssistant, default_sensor, caplog): default_sensor._init_mode(state) assert default_sensor._temperature_mode is True - assert default_sensor._attr_device_class is DEVICE_CLASS_TEMPERATURE + assert default_sensor._attr_device_class is SensorDeviceClass.TEMPERATURE assert ( default_sensor._attr_native_unit_of_measurement == hass.config.units.temperature_unit @@ -380,7 +379,7 @@ async def test__init_mode(hass: HomeAssistant, default_sensor, caplog): default_sensor._init_mode(state) assert default_sensor._temperature_mode is True - assert default_sensor._attr_device_class is DEVICE_CLASS_TEMPERATURE + assert default_sensor._attr_device_class is SensorDeviceClass.TEMPERATURE assert ( default_sensor._attr_native_unit_of_measurement == hass.config.units.temperature_unit From 485ac43becfcaaa0a4e2b03f92050002f248ddc7 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 19:06:15 +0300 Subject: [PATCH 66/90] Bump version to 2.3.3 --- custom_components/average/const.py | 2 +- custom_components/average/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/average/const.py b/custom_components/average/const.py index 989adec..c2ac34d 100644 --- a/custom_components/average/const.py +++ b/custom_components/average/const.py @@ -12,7 +12,7 @@ NAME: Final = "Average Sensor" DOMAIN: Final = "average" -VERSION: Final = "2.3.2" +VERSION: Final = "2.3.3" ISSUE_URL: Final = "https://github.com/Limych/ha-average/issues" STARTUP_MESSAGE: Final = f""" diff --git a/custom_components/average/manifest.json b/custom_components/average/manifest.json index 4a81409..bf2c212 100644 --- a/custom_components/average/manifest.json +++ b/custom_components/average/manifest.json @@ -15,5 +15,5 @@ "iot_class": "calculated", "issue_tracker": "https://github.com/Limych/ha-average/issues", "requirements": [], - "version": "2.3.2" + "version": "2.3.3" } \ No newline at end of file From 38917fbde9f95563f629f28372d2eef7460dcc80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:53:42 +0000 Subject: [PATCH 67/90] Update pip requirement from <23.2,>=21.0 to >=21.0,<24.1 Updates the requirements on [pip](https://github.com/pypa/pip) to permit the latest version. - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/pip/compare/21.0...24.0) --- updated-dependencies: - dependency-name: pip dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a89241a..79d0add 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ homeassistant>=2023.8.0 -pip>=21.0,<23.2 +pip>=21.0,<24.1 From 720e2ad95defd3aa88a77f9d3c55534063d25231 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:53:47 +0000 Subject: [PATCH 68/90] Update yamllint requirement from ~=1.33 to ~=1.35 Updates the requirements on [yamllint](https://github.com/adrienverge/yamllint) to permit the latest version. - [Changelog](https://github.com/adrienverge/yamllint/blob/master/CHANGELOG.rst) - [Commits](https://github.com/adrienverge/yamllint/compare/v1.33.0...v1.35.1) --- updated-dependencies: - dependency-name: yamllint dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d783d15..f050b6b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,4 +4,4 @@ packaging==23.2 pre-commit~=3.6 PyGithub~=2.2 pyupgrade~=3.15 -yamllint~=1.33 +yamllint~=1.35 From ce640b1ab2020f568c728eb4007f26b1649244e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:53:56 +0000 Subject: [PATCH 69/90] Update colorlog requirement from ~=6.7 to ~=6.8 Updates the requirements on [colorlog](https://github.com/borntyping/python-colorlog) to permit the latest version. - [Release notes](https://github.com/borntyping/python-colorlog/releases) - [Commits](https://github.com/borntyping/python-colorlog/compare/v6.7.0...v6.8.2) --- updated-dependencies: - dependency-name: colorlog dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index fb85c33..d84bdf7 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,7 +1,7 @@ -r requirements.txt async-timeout asynctest~=0.13 -colorlog~=6.7 +colorlog~=6.8 flake8~=7.0 flake8-docstrings~=1.7 mypy==1.8.0 From 6b97d1522f4814365b2aad5549c5be3ce1d39548 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:54:03 +0000 Subject: [PATCH 70/90] Update pylint requirement from ~=3.0 to ~=3.1 Updates the requirements on [pylint](https://github.com/pylint-dev/pylint) to permit the latest version. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index fb85c33..74c7f6a 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -5,7 +5,7 @@ colorlog~=6.7 flake8~=7.0 flake8-docstrings~=1.7 mypy==1.8.0 -pylint~=3.0 +pylint~=3.1 pylint-strict-informational==0.1 pytest>=7.2 pytest-cov>=3.0 From 70fad05be145d792ac5600770716e36bff6a4062 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:54:19 +0000 Subject: [PATCH 71/90] Update ruff requirement from ~=0.1 to ~=0.3 Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.1.0...v0.3.0) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index fb85c33..bfa877c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -11,4 +11,4 @@ pytest>=7.2 pytest-cov>=3.0 pytest-homeassistant-custom-component>=0.12 tzdata -ruff~=0.1 +ruff~=0.3 From ed9aa27698d77f3079966af80421cbbac4d5ec85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 14:59:01 +0000 Subject: [PATCH 72/90] Bump softprops/action-gh-release from 1 to 2 Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f620576..884fa59 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: - name: "Release" if: env.release_version != '' && success() - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: ${{ env.basedir }}/${{ env.package }}.zip From 873750c5cc03096eee26a6b9a8ea41521810f8cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:43:23 +0000 Subject: [PATCH 73/90] Bump black from 24.2.0 to 24.3.0 Bumps [black](https://github.com/psf/black) from 24.2.0 to 24.3.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.2.0...24.3.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d783d15..49615af 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ -r requirements-test.txt -black==24.2.0 +black==24.3.0 packaging==23.2 pre-commit~=3.6 PyGithub~=2.2 From 7f64f57792150d64b0654d895ee9a5adbe721898 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 20 Mar 2024 18:55:32 +0300 Subject: [PATCH 74/90] Update requiremints --- requirements-dev.txt | 4 ++-- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 92b6c1a..1968118 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ -r requirements-test.txt -black==24.3.0 -packaging==23.2 +black~=24.3 +packaging~=24.0 pre-commit~=3.6 PyGithub~=2.2 pyupgrade~=3.15 diff --git a/requirements.txt b/requirements.txt index 79d0add..4060e25 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ homeassistant>=2023.8.0 -pip>=21.0,<24.1 +pip>=21.0 From 52b59cf0daf7283e6777cb0bc5b4b0fd20b1e336 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:46:37 +0000 Subject: [PATCH 75/90] Update pygithub requirement from ~=2.2 to ~=2.3 Updates the requirements on [pygithub](https://github.com/pygithub/pygithub) to permit the latest version. - [Release notes](https://github.com/pygithub/pygithub/releases) - [Changelog](https://github.com/PyGithub/PyGithub/blob/main/doc/changes.rst) - [Commits](https://github.com/pygithub/pygithub/compare/v2.2.0...v2.3.0) --- updated-dependencies: - dependency-name: pygithub dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1968118..68f2072 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,6 +2,6 @@ black~=24.3 packaging~=24.0 pre-commit~=3.6 -PyGithub~=2.2 +PyGithub~=2.3 pyupgrade~=3.15 yamllint~=1.35 From 2e9f8dd3c92fa883d0c18178a9b9315ba87e3c48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:46:47 +0000 Subject: [PATCH 76/90] Bump mypy from 1.8.0 to 1.9.0 Bumps [mypy](https://github.com/python/mypy) from 1.8.0 to 1.9.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.8.0...1.9.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 5747413..ed05cc6 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -4,7 +4,7 @@ asynctest~=0.13 colorlog~=6.8 flake8~=7.0 flake8-docstrings~=1.7 -mypy==1.8.0 +mypy==1.9.0 pylint~=3.1 pylint-strict-informational==0.1 pytest>=7.2 From 16e3383dadf23df808313ad3a4c0b4a74ae99e9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 12:14:04 +0000 Subject: [PATCH 77/90] Update pre-commit requirement from ~=3.6 to ~=3.7 Updates the requirements on [pre-commit](https://github.com/pre-commit/pre-commit) to permit the latest version. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.6.0...v3.7.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 68f2072..e566241 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ -r requirements-test.txt black~=24.3 packaging~=24.0 -pre-commit~=3.6 +pre-commit~=3.7 PyGithub~=2.3 pyupgrade~=3.15 yamllint~=1.35 From 2382158740630e9eb3292d863f053a58660b5519 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 27 Mar 2024 15:32:07 +0300 Subject: [PATCH 78/90] Fix #99 --- custom_components/average/const.py | 5 ++--- custom_components/average/manifest.json | 2 +- custom_components/average/sensor.py | 20 ++++++++++++-------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/custom_components/average/const.py b/custom_components/average/const.py index c2ac34d..569640c 100644 --- a/custom_components/average/const.py +++ b/custom_components/average/const.py @@ -1,5 +1,4 @@ -""" -The Average Sensor. +"""The Average Sensor. For more details about this sensor, please refer to the documentation at https://github.com/Limych/ha-average/ @@ -12,7 +11,7 @@ NAME: Final = "Average Sensor" DOMAIN: Final = "average" -VERSION: Final = "2.3.3" +VERSION: Final = "2.3.4-alpha" ISSUE_URL: Final = "https://github.com/Limych/ha-average/issues" STARTUP_MESSAGE: Final = f""" diff --git a/custom_components/average/manifest.json b/custom_components/average/manifest.json index bf2c212..5c5411f 100644 --- a/custom_components/average/manifest.json +++ b/custom_components/average/manifest.json @@ -15,5 +15,5 @@ "iot_class": "calculated", "issue_tracker": "https://github.com/Limych/ha-average/issues", "requirements": [], - "version": "2.3.3" + "version": "2.3.4-alpha" } \ No newline at end of file diff --git a/custom_components/average/sensor.py b/custom_components/average/sensor.py index 5aef544..ae2b63b 100644 --- a/custom_components/average/sensor.py +++ b/custom_components/average/sensor.py @@ -22,7 +22,11 @@ from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN from homeassistant.components.group import expand_entity_ids from homeassistant.components.recorder import get_instance, history -from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass, SensorEntity +from homeassistant.components.sensor import ( + SensorDeviceClass, + SensorEntity, + SensorStateClass, +) from homeassistant.components.water_heater import DOMAIN as WATER_HEATER_DOMAIN from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN from homeassistant.const import ( @@ -34,7 +38,7 @@ CONF_UNIQUE_ID, EVENT_HOMEASSISTANT_START, STATE_UNAVAILABLE, - STATE_UNKNOWN + STATE_UNKNOWN, ) from homeassistant.core import HomeAssistant, State, callback, split_entity_id from homeassistant.exceptions import TemplateError @@ -389,9 +393,7 @@ async def _async_update_period(self): # pylint: disable=too-many-branches if start > now: # History hasn't been written yet for this period return - if now < end: - # No point in making stats of the future - end = now + end = min(end, now) # No point in making stats of the future self._period = start, end self.start = start.replace(microsecond=0).isoformat() @@ -530,13 +532,15 @@ async def _async_update_state( last_time = current_time # Count time elapsed between last history state and now - if last_state is not None: + if last_state is None: + value = None + else: last_elapsed = end_ts - last_time value += last_state * last_elapsed elapsed += last_elapsed + if elapsed: + value /= elapsed - if elapsed: - value /= elapsed _LOGGER.debug("Historical average state: %s", value) if isinstance(value, numbers.Number): From fd0c46fc9f40126edc70b40635139325912a095a Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 27 Mar 2024 15:35:47 +0300 Subject: [PATCH 79/90] Bump version to 2.3.4 --- custom_components/average/const.py | 2 +- custom_components/average/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/average/const.py b/custom_components/average/const.py index 569640c..c01afb2 100644 --- a/custom_components/average/const.py +++ b/custom_components/average/const.py @@ -11,7 +11,7 @@ NAME: Final = "Average Sensor" DOMAIN: Final = "average" -VERSION: Final = "2.3.4-alpha" +VERSION: Final = "2.3.4" ISSUE_URL: Final = "https://github.com/Limych/ha-average/issues" STARTUP_MESSAGE: Final = f""" diff --git a/custom_components/average/manifest.json b/custom_components/average/manifest.json index 5c5411f..a85831a 100644 --- a/custom_components/average/manifest.json +++ b/custom_components/average/manifest.json @@ -15,5 +15,5 @@ "iot_class": "calculated", "issue_tracker": "https://github.com/Limych/ha-average/issues", "requirements": [], - "version": "2.3.4-alpha" + "version": "2.3.4" } \ No newline at end of file From c99fe22bf082c29b5fb7f5404f8dc317a0bd242a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:41:11 +0000 Subject: [PATCH 80/90] Update black requirement from ~=24.3 to ~=24.4 Updates the requirements on [black](https://github.com/psf/black) to permit the latest version. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.3.0...24.4.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e566241..3357394 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ -r requirements-test.txt -black~=24.3 +black~=24.4 packaging~=24.0 pre-commit~=3.7 PyGithub~=2.3 From 068059aa01475b28ac981af179e817c4df941c90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:42:20 +0000 Subject: [PATCH 81/90] Update ruff requirement from ~=0.3 to ~=0.4 Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.3.0...v0.4.1) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index ed05cc6..aa68b7c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -11,4 +11,4 @@ pytest>=7.2 pytest-cov>=3.0 pytest-homeassistant-custom-component>=0.12 tzdata -ruff~=0.3 +ruff~=0.4 From bb37d991c0614a1f33d250168455526a95a213e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:52:52 +0000 Subject: [PATCH 82/90] Bump mypy from 1.9.0 to 1.10.0 Bumps [mypy](https://github.com/python/mypy) from 1.9.0 to 1.10.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index ed05cc6..ce2d5b6 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -4,7 +4,7 @@ asynctest~=0.13 colorlog~=6.8 flake8~=7.0 flake8-docstrings~=1.7 -mypy==1.9.0 +mypy==1.10.0 pylint~=3.1 pylint-strict-informational==0.1 pytest>=7.2 From c268d78fbb9da125dfa18a3204c5005641635fb0 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Thu, 2 May 2024 21:46:43 +0300 Subject: [PATCH 83/90] Update requiremints --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index f2753e4..d0f4f99 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -4,7 +4,7 @@ asynctest~=0.13 colorlog~=6.8 flake8~=7.0 flake8-docstrings~=1.7 -mypy==1.10.0 +mypy~=1.10 pylint~=3.1 pylint-strict-informational==0.1 pytest>=7.2 From a2670423f764cb05f5bc45c30d378d00612fc54a Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Thu, 2 May 2024 23:42:12 +0300 Subject: [PATCH 84/90] Fix setup script for Python 3.12 --- scripts/setup | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/setup b/scripts/setup index 650a348..170bb07 100755 --- a/scripts/setup +++ b/scripts/setup @@ -19,6 +19,8 @@ if [ ! -d "venv" ]; then ${python} -m venv ./venv source ./venv/bin/activate python="${ROOT}/venv/bin/python3" +else + ${python} -m venv ./venv fi pip="${python} -m pip" From 31cbdb51dd3550cd5db2edac6d906156be6984b0 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 8 May 2024 22:57:53 +0300 Subject: [PATCH 85/90] Update dev environment --- .devcontainer.json | 16 +++-- .github/ISSUE_TEMPLATE/bug.yml | 4 +- .github/ISSUE_TEMPLATE/bug_report.md | 70 ---------------------- .github/ISSUE_TEMPLATE/feature_request.md | 40 ------------- .github/ISSUE_TEMPLATE/feature_request.yml | 4 +- .github/workflows/lint.yml | 2 +- .github/workflows/py-dead-code.yml | 2 +- .github/workflows/py-test.yml | 23 +------ .github/workflows/release.yml | 2 +- .pre-commit-config.yaml | 10 ++-- .ruff.toml | 10 ++-- hacs.json | 2 +- pylintrc | 2 +- pyproject.toml | 9 ++- requirements-test.txt | 4 +- requirements.txt | 4 +- tests/bandit.yaml | 1 - 17 files changed, 42 insertions(+), 163 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.devcontainer.json b/.devcontainer.json index c70f1f5..5cec644 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,6 +1,6 @@ { "name": "ludeeus/integration_blueprint", - "image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye", + "image": "mcr.microsoft.com/devcontainers/python:1-3.12", "postCreateCommand": "scripts/setup", "forwardPorts": [ 8123 @@ -17,17 +17,21 @@ "ms-python.python", "github.vscode-pull-request-github", "ryanluker.vscode-coverage-gutters", - "ms-python.vscode-pylance" + "ms-python.vscode-pylance", + "ms-python.black-formatter", + "ms-python.pylint" ], "settings": { "files.eol": "\n", "editor.tabSize": 4, "python.pythonPath": "/usr/bin/python3", "python.analysis.autoSearchPaths": false, - "python.linting.pylintEnabled": true, - "python.linting.enabled": true, - "python.formatting.provider": "black", - "python.formatting.blackPath": "/usr/local/py-utils/bin/black", + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" + }, + "black-formatter.path": [ + "/usr/local/py-utils/bin/black" + ], "editor.formatOnPaste": false, "editor.formatOnSave": true, "editor.formatOnType": true, diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index d8b9ed6..150595c 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,7 +1,7 @@ --- name: "Bug report" description: "Report a bug with the integration" -labels: "Bug" +labels: "bug" body: - type: markdown attributes: @@ -22,7 +22,7 @@ body: required: true - label: This issue only contains 1 issue (if you have multiple issues, open one issue for each issue). required: true - - label: This issue is not a duplicate issue of any [previous issues](https://github.com/ludeeus/integration_blueprint/issues?q=is%3Aissue+label%3A%22Bug%22+).. + - label: This issue is not a duplicate issue of any [previous issues](https://github.com/Limych/ha-blueprint/issues?q=is%3Aissue+label%3A%22bug%22+).. required: true - type: textarea attributes: diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 5df85e3..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve component -title: '' -labels: 'bug' -assignees: '' - ---- - - - -**Environment** - - -- Home Assistant Core release with the issue: -- This custom component release with the issue: -- Last working this custom component release (if known): -- Operating environment (Home Assistant/Supervisor/Docker/venv): - -**Describe the bug** - - - -**Configuration.yaml** -```yaml - -Add your configs here if any. - -``` - -**Steps to Reproduce** - - - -**Expected behavior** - - - -**Debug log** - -```text - -Add your logs here. - -``` - -**Additional context** - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index c2d2583..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: 'enhancement' -assignees: '' - ---- - - - -**Is your feature request related to a problem? Please describe.** - - - -**Describe the solution you'd like** - - - -**Describe alternatives you've considered** - - - -**Additional context** - diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 433467b..5b34fa1 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,7 +1,7 @@ --- name: "Feature request" description: "Suggest an idea for this project" -labels: "Feature+Request" +labels: "enhancement" body: - type: markdown attributes: @@ -14,7 +14,7 @@ body: required: true - label: This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request). required: true - - label: This issue is not a duplicate feature request of [previous feature requests](https://github.com/ludeeus/integration_blueprint/issues?q=is%3Aissue+label%3A%22Feature+Request%22+). + - label: This issue is not a duplicate feature request of [previous feature requests](https://github.com/Limych/ha-blueprint/issues?q=is%3Aissue+label%3A%22enhancement%22+). required: true - type: textarea diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 091336c..4e07fbc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - name: "Set up Python" uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version-file: 'pyproject.toml' cache: "pip" - name: "Install requirements" diff --git a/.github/workflows/py-dead-code.yml b/.github/workflows/py-dead-code.yml index 3cdda49..5e3744b 100644 --- a/.github/workflows/py-dead-code.yml +++ b/.github/workflows/py-dead-code.yml @@ -17,7 +17,7 @@ jobs: - name: "Set up Python" uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version-file: 'pyproject.toml' - name: "Cache pip" uses: actions/cache@v4 diff --git a/.github/workflows/py-test.yml b/.github/workflows/py-test.yml index 6b97e0a..8745372 100644 --- a/.github/workflows/py-test.yml +++ b/.github/workflows/py-test.yml @@ -25,7 +25,7 @@ jobs: - name: "Set up Python" uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version-file: 'pyproject.toml' - name: "Cache pip" uses: actions/cache@v4 @@ -64,22 +64,14 @@ jobs: needs: lint runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental }} - strategy: - max-parallel: 3 - matrix: - python-version: ['3.11', '3.12'] - experimental: [false] -# include: -# - python-version: '3.12' -# experimental: true steps: - name: "Checkout code" uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: "Set up Python" uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version-file: 'pyproject.toml' - name: "Cache pip" uses: actions/cache@v4 @@ -109,25 +101,16 @@ jobs: echo '"""Stub."""' >custom_components/__init__.py fi - - name: "Run tests with pytest" - if: matrix.python-version != '3.11' - run: | - pytest --basetemp=$RUNNER_TEMP --durations=10 -n auto --dist=loadfile -qq -o console_output_style=count -p no:sugar - ./scripts/check_dirty - - name: "Install Coveralls" - if: matrix.python-version == '3.11' run: | pip install pytest-xdist coveralls - name: "Run tests with pytest & Calculate coverage" - if: matrix.python-version == '3.11' run: | pytest --basetemp=$RUNNER_TEMP --durations=10 -n auto --dist=loadfile -qq -o console_output_style=count -p no:sugar --cov --cov-report= ./scripts/check_dirty - name: "Send coverage to Coveralls" - if: matrix.python-version == '3.11' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: coveralls --service=github diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 884fa59..0fd446b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: if: env.release_version != '' && success() uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version-file: 'pyproject.toml' - name: "Cache pip" if: env.release_version != '' && success() diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea74596..97b27ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,20 +7,20 @@ repos: language: script files: ^(custom_components/.+/const\.py|requirements\.txt)$ - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.241 + rev: v0.3.5 hooks: - id: ruff args: - --fix files: ^(custom_components|bin|tests)/.+\.py$ - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.15.2 hooks: - id: pyupgrade - args: [ --py310-plus ] + args: [ --py312-plus ] stages: [manual] - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 24.3.0 hooks: - id: black args: @@ -37,7 +37,7 @@ repos: files: ^(custom_components|bin|tests)/.+\.py$ stages: [manual] - repo: https://github.com/PyCQA/bandit - rev: 1.7.4 + rev: 1.7.8 hooks: - id: bandit args: diff --git a/.ruff.toml b/.ruff.toml index 7a8331a..384e20e 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -1,6 +1,6 @@ # The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml -target-version = "py310" +target-version = "py312" select = [ "B007", # Loop control variable {name} not used within loop body @@ -38,11 +38,11 @@ ignore = [ "E731", # do not assign a lambda expression, use a def ] -[flake8-pytest-style] +[lint.flake8-pytest-style] fixture-parentheses = false -[pyupgrade] +[lint.pyupgrade] keep-runtime-typing = true -[mccabe] -max-complexity = 25 \ No newline at end of file +[lint.mccabe] +max-complexity = 25 diff --git a/hacs.json b/hacs.json index 0c12f64..3fca37c 100644 --- a/hacs.json +++ b/hacs.json @@ -2,7 +2,7 @@ "name": "Integration blueprint", "filename": "integration_blueprint.zip", "hide_default_branch": true, - "homeassistant": "2023.8.0", + "homeassistant": "2024.4.0", "render_readme": true, "zip_release": true } diff --git a/pylintrc b/pylintrc index 850e50d..7b6263c 100644 --- a/pylintrc +++ b/pylintrc @@ -3,7 +3,7 @@ ignore=tests # Use a conservative default here; 2 should speed up most setups and not hurt # any too bad. Override on command line as appropriate. jobs=2 -load-plugins=pylint_strict_informational +fail-on=I persistent=no extension-pkg-whitelist=ciso8601 diff --git a/pyproject.toml b/pyproject.toml index cb14c1b..1b2b658 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,8 @@ +[project] +requires-python = ">=3.12" + [tool.black] -target-version = ["py310"] +target-version = ["py312"] extend-exclude = "/generated/" [tool.isort] @@ -17,7 +20,7 @@ forced_separate = [ combine_as_imports = true [tool.pylint.MAIN] -py-version = "3.10" +py-version = "3.12" ignore = [ "tests", ] @@ -162,7 +165,7 @@ log_date_format = "%Y-%m-%d %H:%M:%S" asyncio_mode = "auto" [tool.ruff] -target-version = "py310" +target-version = "py312" select = [ "C", # complexity diff --git a/requirements-test.txt b/requirements-test.txt index d0f4f99..e98091b 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -9,6 +9,6 @@ pylint~=3.1 pylint-strict-informational==0.1 pytest>=7.2 pytest-cov>=3.0 -pytest-homeassistant-custom-component>=0.12 +pytest-homeassistant-custom-component>=0.13 tzdata -ruff~=0.4 +ruff>=0.4 diff --git a/requirements.txt b/requirements.txt index 4060e25..02a0900 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -homeassistant>=2023.8.0 -pip>=21.0 +homeassistant>=2024.4.0 +pip>=24.0 diff --git a/tests/bandit.yaml b/tests/bandit.yaml index ebd284e..dcacabd 100644 --- a/tests/bandit.yaml +++ b/tests/bandit.yaml @@ -12,6 +12,5 @@ tests: - B318 - B319 - B320 - - B325 - B602 - B604 From 4888d5e67f56fa6956dcc8f27aad5b5c5792f250 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Wed, 8 May 2024 23:00:31 +0300 Subject: [PATCH 86/90] Update dev environment --- .github/workflows/py-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/py-test.yml b/.github/workflows/py-test.yml index 8745372..ce8363b 100644 --- a/.github/workflows/py-test.yml +++ b/.github/workflows/py-test.yml @@ -63,7 +63,6 @@ jobs: name: Test package on Python ${{ matrix.python-version }} needs: lint runs-on: ubuntu-latest - continue-on-error: ${{ matrix.experimental }} steps: - name: "Checkout code" uses: actions/checkout@v4 From 3ba32826b641f0621fda339e6736a33a89b6e7e5 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Thu, 9 May 2024 00:28:56 +0300 Subject: [PATCH 87/90] Update .ruff.toml --- .github/workflows/py-test.yml | 2 +- .ruff.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/py-test.yml b/.github/workflows/py-test.yml index ce8363b..77d6e6d 100644 --- a/.github/workflows/py-test.yml +++ b/.github/workflows/py-test.yml @@ -60,7 +60,7 @@ jobs: pylint ${{ env.package }} tests tests: - name: Test package on Python ${{ matrix.python-version }} + name: "Test package" needs: lint runs-on: ubuntu-latest steps: diff --git a/.ruff.toml b/.ruff.toml index 384e20e..eb68b8c 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -2,7 +2,7 @@ target-version = "py312" -select = [ +lint.select = [ "B007", # Loop control variable {name} not used within loop body "B014", # Exception handler with duplicate exception "C", # complexity @@ -26,7 +26,7 @@ select = [ "W", # pycodestyle ] -ignore = [ +lint.ignore = [ "D202", # No blank lines allowed after function docstring "D203", # 1 blank line required before class docstring "D213", # Multi-line docstring summary should start at the second line From a19adc00eca6878974e4e17ec807aac1c967c5cf Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Thu, 9 May 2024 00:50:58 +0300 Subject: [PATCH 88/90] Change async_track_state_change -> async_track_state_change_event (#237) --- custom_components/average/sensor.py | 31 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/custom_components/average/sensor.py b/custom_components/average/sensor.py index ae2b63b..678d59f 100644 --- a/custom_components/average/sensor.py +++ b/custom_components/average/sensor.py @@ -14,7 +14,7 @@ import logging import math import numbers -from typing import Any, Optional +from typing import Any from _sha1 import sha1 import voluptuous as vol @@ -40,11 +40,18 @@ STATE_UNAVAILABLE, STATE_UNKNOWN, ) -from homeassistant.core import HomeAssistant, State, callback, split_entity_id +from homeassistant.core import ( + Event, + EventStateChangedData, + HomeAssistant, + State, + callback, + split_entity_id, +) from homeassistant.exceptions import TemplateError from homeassistant.helpers import config_validation as cv from homeassistant.helpers.config_validation import PLATFORM_SCHEMA -from homeassistant.helpers.event import async_track_state_change +from homeassistant.helpers.event import async_track_state_change_event from homeassistant.util import Throttle import homeassistant.util.dt as dt_util from homeassistant.util.unit_conversion import TemperatureConverter @@ -152,7 +159,7 @@ class AverageSensor(SensorEntity): def __init__( self, hass: HomeAssistant, - unique_id: Optional[str], + unique_id: str | None, name: str, start, end, @@ -215,7 +222,7 @@ def available(self) -> bool: return self.available_sources > 0 and self._has_state(self._attr_native_value) @property - def extra_state_attributes(self) -> Optional[Mapping[str, Any]]: + def extra_state_attributes(self) -> Mapping[str, Any] | None: """Return entity specific state attributes.""" state_attr = { attr: getattr(self, attr) @@ -229,7 +236,9 @@ async def async_added_to_hass(self) -> None: # pylint: disable=unused-argument @callback - async def async_sensor_state_listener(entity, old_state, new_state): + async def async_sensor_state_listener( + event: Event[EventStateChangedData], + ) -> None: """Handle device state changes.""" last_state = self._attr_native_value await self._async_update_state() @@ -243,10 +252,10 @@ async def async_sensor_startup(event): if self._has_period: self.async_schedule_update_ha_state(True) else: - async_track_state_change( + async_track_state_change_event( self.hass, self.sources, async_sensor_state_listener ) - await async_sensor_state_listener(None, None, None) + await async_sensor_state_listener(Event("startup")) self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, async_sensor_startup) @@ -260,7 +269,7 @@ def _has_state(state) -> bool: "", ] - def _get_temperature(self, state: State) -> Optional[float]: + def _get_temperature(self, state: State) -> float | None: """Get temperature value from entity.""" ha_unit = self.hass.config.units.temperature_unit domain = split_entity_id(state.entity_id)[0] @@ -287,7 +296,7 @@ def _get_temperature(self, state: State) -> Optional[float]: return temperature - def _get_state_value(self, state: State) -> Optional[float]: + def _get_state_value(self, state: State) -> float | None: """Return value of given entity state and count some sensor attributes.""" state = self._get_temperature(state) if self._temperature_mode else state.state if not self._has_state(state): @@ -497,7 +506,7 @@ async def _async_update_state( ) if ( - entity_id not in history_list.keys() + entity_id not in history_list or history_list[entity_id] is None or len(history_list[entity_id]) == 0 ): From e1c104843010366b4dd79de0900a10ff1215dbc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 21:54:10 +0000 Subject: [PATCH 89/90] Update fnv-hash-fast requirement from ~=0.4 to ~=0.5 Updates the requirements on [fnv-hash-fast](https://github.com/bdraco/fnv-hash-fast) to permit the latest version. - [Release notes](https://github.com/bdraco/fnv-hash-fast/releases) - [Changelog](https://github.com/bdraco/fnv-hash-fast/blob/main/CHANGELOG.md) - [Commits](https://github.com/bdraco/fnv-hash-fast/compare/v0.4.0...v0.5.0) --- updated-dependencies: - dependency-name: fnv-hash-fast dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 593a18d..2fd885e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,7 +2,7 @@ colorlog~=6.8 flake8~=7.0 flake8-docstrings~=1.7 -fnv-hash-fast~=0.4 +fnv-hash-fast~=0.5 mypy~=1.10 psutil-home-assistant==0.0.1 pylint~=3.1 From a686aa95688fd0e88c97b64eeca98c21a9c74923 Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Thu, 9 May 2024 01:00:34 +0300 Subject: [PATCH 90/90] Remove commented out code --- custom_components/average/__init__.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/custom_components/average/__init__.py b/custom_components/average/__init__.py index 966dba5..541089f 100644 --- a/custom_components/average/__init__.py +++ b/custom_components/average/__init__.py @@ -2,8 +2,7 @@ # Creative Commons BY-NC-SA 4.0 International Public License # (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/) -""" -The Average Sensor. +"""The Average Sensor. For more details about this sensor, please refer to the documentation at https://github.com/Limych/ha-average/ @@ -13,9 +12,9 @@ import logging import voluptuous as vol + from homeassistant.const import SERVICE_RELOAD from homeassistant.core import HomeAssistant, ServiceCall -from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.reload import async_reload_integration_platforms from homeassistant.helpers.typing import ConfigType @@ -29,16 +28,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # Print startup message _LOGGER.info(STARTUP_MESSAGE) - # await async_setup_reload_service(hass, DOMAIN, PLATFORMS) - - component = EntityComponent(_LOGGER, DOMAIN, hass) - async def reload_service_handler(service: ServiceCall) -> None: """Reload all average sensors from config.""" - print("+++++++++++++++++++++++++") - print(component) - # print(hass.data[DATA_INSTANCES]["sensor"].entities[0]) - await async_reload_integration_platforms(hass, DOMAIN, PLATFORMS) hass.services.async_register(