From 3ebcb525138c4638345c1f2709dacb1fdc5015f1 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Mon, 15 Apr 2024 12:30:14 -0400 Subject: [PATCH 01/53] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 48f6f5d3..a8885ec2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "blinkpy" -version = "0.22.7" +version = "0.23.0b7" license = {text = "MIT"} description = "A Blink camera Python Library." readme = "README.rst" From 3d3366461a5c3ccabeaa44aae1664cfee00da97a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 18:55:45 +0000 Subject: [PATCH 02/53] Bump black from 24.3.0 to 24.4.0 Bumps [black](https://github.com/psf/black) from 24.3.0 to 24.4.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.3.0...24.4.0) --- updated-dependencies: - dependency-name: black 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 29116a5a..9fef8cd4 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,5 +1,5 @@ ruff==0.3.7 -black==24.3.0 +black==24.4.0 build==1.2.1 coverage==7.4.4 pytest==8.1.1 From d2215fba78eed263aa48a128261216251f006f05 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 18:31:47 +0000 Subject: [PATCH 03/53] Bump ruff from 0.3.7 to 0.4.1 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.7 to 0.4.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.3.7...v0.4.1) --- updated-dependencies: - dependency-name: ruff 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 9fef8cd4..d101ea3c 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -ruff==0.3.7 +ruff==0.4.1 black==24.4.0 build==1.2.1 coverage==7.4.4 From 28e96d2a76a713455cf0843204b1138d54552400 Mon Sep 17 00:00:00 2001 From: mkmer Date: Sun, 21 Apr 2024 15:04:36 +0000 Subject: [PATCH 04/53] Import .ospath --- blinkpy/blinkpy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/blinkpy/blinkpy.py b/blinkpy/blinkpy.py index 027e2fff..e46a2c56 100644 --- a/blinkpy/blinkpy.py +++ b/blinkpy/blinkpy.py @@ -17,6 +17,7 @@ import logging import datetime import aiofiles +import aiofiles.ospath from requests.structures import CaseInsensitiveDict from dateutil.parser import parse from slugify import slugify From f54c704c188406c74544196109475b29eb34db8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:14:41 +0000 Subject: [PATCH 05/53] Bump ruff from 0.4.1 to 0.4.2 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.1 to 0.4.2. - [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.4.1...v0.4.2) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... 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 d101ea3c..6df89eab 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -ruff==0.4.1 +ruff==0.4.2 black==24.4.0 build==1.2.1 coverage==7.4.4 From a544b5af1902a189e49ed1b81e1b92d4dc7bc0c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:22:10 +0000 Subject: [PATCH 06/53] Bump coverage from 7.4.4 to 7.5.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.4.4 to 7.5.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.4.4...7.5.0) --- updated-dependencies: - dependency-name: coverage 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 6df89eab..c90936bb 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,7 +1,7 @@ ruff==0.4.2 black==24.4.0 build==1.2.1 -coverage==7.4.4 +coverage==7.5.0 pytest==8.1.1 pytest-cov==5.0.0 pytest-sugar==1.0.0 From b904a6cd9cfb074cf4f900811cb6ceebc1d51170 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:22:43 +0000 Subject: [PATCH 07/53] Bump black from 24.4.0 to 24.4.1 Bumps [black](https://github.com/psf/black) from 24.4.0 to 24.4.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/24.4.0...24.4.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:production update-type: version-update:semver-patch ... 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 c90936bb..91786022 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,5 +1,5 @@ ruff==0.4.2 -black==24.4.0 +black==24.4.1 build==1.2.1 coverage==7.5.0 pytest==8.1.1 From e230d6878aba383fa0471e31625e6fdb39c56b9a Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Thu, 25 Apr 2024 15:11:08 -0400 Subject: [PATCH 08/53] Add user_id field --- blinkpy/auth.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blinkpy/auth.py b/blinkpy/auth.py index 78db9d9a..8f5a7de1 100644 --- a/blinkpy/auth.py +++ b/blinkpy/auth.py @@ -49,6 +49,7 @@ def __init__( self.region_id = login_data.get("region_id", None) self.client_id = login_data.get("client_id", None) self.account_id = login_data.get("account_id", None) + self.user_id = login_data.get("user_id", None) self.login_response = None self.is_errored = False self.no_prompt = no_prompt @@ -64,6 +65,7 @@ def login_attributes(self): self.data["region_id"] = self.region_id self.data["client_id"] = self.client_id self.data["account_id"] = self.account_id + self.data["user_id"] = self.user_id return self.data @property From c713f5a3b4e05af81fe12fb5f5f0a87fed082a80 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Thu, 25 Apr 2024 15:14:38 -0400 Subject: [PATCH 09/53] Update request_verify url to new endpoint See #917 --- blinkpy/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blinkpy/api.py b/blinkpy/api.py index 942d29d8..04f3657d 100644 --- a/blinkpy/api.py +++ b/blinkpy/api.py @@ -62,8 +62,9 @@ async def request_login( async def request_verify(auth, blink, verify_key): """Send verification key to blink servers.""" url = ( - f"{blink.urls.base_url}/api/v4/account/{blink.account_id}" - f"/client/{blink.client_id}/pin/verify" + f"{blink.urls.base_url}/api/v5/accounts/{blink.account_id}" + f"/users/{blink.auth.user_id} + f"/clients/{blink.client_id}/client_verification/pin/verify" ) data = dumps({"pin": verify_key}) return await auth.query( From 980b9438e7fd12b90077dac34a96b08a12456e6d Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Thu, 25 Apr 2024 15:19:56 -0400 Subject: [PATCH 10/53] Missing quotation --- blinkpy/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blinkpy/api.py b/blinkpy/api.py index 04f3657d..c4121248 100644 --- a/blinkpy/api.py +++ b/blinkpy/api.py @@ -63,7 +63,7 @@ async def request_verify(auth, blink, verify_key): """Send verification key to blink servers.""" url = ( f"{blink.urls.base_url}/api/v5/accounts/{blink.account_id}" - f"/users/{blink.auth.user_id} + f"/users/{blink.auth.user_id}" f"/clients/{blink.client_id}/client_verification/pin/verify" ) data = dumps({"pin": verify_key}) From 83b1a2dc994829a8beddb5020023f911bf9ecf0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:41:10 +0000 Subject: [PATCH 11/53] Bump black from 24.4.1 to 24.4.2 Bumps [black](https://github.com/psf/black) from 24.4.1 to 24.4.2. - [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.4.1...24.4.2) --- updated-dependencies: - dependency-name: black dependency-type: direct:production update-type: version-update:semver-patch ... 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 91786022..19c0d14d 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,5 +1,5 @@ ruff==0.4.2 -black==24.4.1 +black==24.4.2 build==1.2.1 coverage==7.5.0 pytest==8.1.1 From 6dc4be1ceee94831c125a42e50bef0a3c5ec257c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:41:15 +0000 Subject: [PATCH 12/53] Bump pytest from 8.1.1 to 8.1.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.1.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.1.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-patch ... 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 91786022..2d9d161f 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -2,7 +2,7 @@ ruff==0.4.2 black==24.4.1 build==1.2.1 coverage==7.5.0 -pytest==8.1.1 +pytest==8.1.2 pytest-cov==5.0.0 pytest-sugar==1.0.0 pytest-timeout==2.3.1 From aa98596920d1128c3a6e59ffbd283ad83ebaa45b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 18:11:55 +0000 Subject: [PATCH 13/53] Bump pygments from 2.17.2 to 2.18.0 Bumps [pygments](https://github.com/pygments/pygments) from 2.17.2 to 2.18.0. - [Release notes](https://github.com/pygments/pygments/releases) - [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES) - [Commits](https://github.com/pygments/pygments/compare/2.17.2...2.18.0) --- updated-dependencies: - dependency-name: pygments 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 fb725046..a26c5ed8 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -7,7 +7,7 @@ pytest-cov==5.0.0 pytest-sugar==1.0.0 pytest-timeout==2.3.1 restructuredtext-lint==1.4.0 -pygments==2.17.2 +pygments==2.18.0 testtools>=2.4.0 sortedcontainers~=2.4.0 pytest-asyncio>=0.21.0 From 4b6d799f8e0c920b75e482bec8817eb3a1c9e638 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 18:20:26 +0000 Subject: [PATCH 14/53] --- updated-dependencies: - dependency-name: pytest 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 fb725046..9652b13f 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -2,7 +2,7 @@ ruff==0.4.2 black==24.4.2 build==1.2.1 coverage==7.5.0 -pytest==8.1.2 +pytest==8.2.1 pytest-cov==5.0.0 pytest-sugar==1.0.0 pytest-timeout==2.3.1 From 4e157b287538c6e3c59f3cd7cc029de434c381d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 18:11:36 +0000 Subject: [PATCH 15/53] Bump ruff from 0.4.2 to 0.4.5 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.2 to 0.4.5. - [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.4.2...v0.4.5) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... 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 fb725046..f92e3c79 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -ruff==0.4.2 +ruff==0.4.5 black==24.4.2 build==1.2.1 coverage==7.5.0 From 6d1e721129d207b5ba032501984d2ee6ef26e7e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 18:35:40 +0000 Subject: [PATCH 16/53] Bump coverage from 7.5.0 to 7.5.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.0 to 7.5.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.0...7.5.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:production update-type: version-update:semver-patch ... 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 6339b9b2..e325377c 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,7 +1,7 @@ ruff==0.4.5 black==24.4.2 build==1.2.1 -coverage==7.5.0 +coverage==7.5.1 pytest==8.2.1 pytest-cov==5.0.0 pytest-sugar==1.0.0 From 6314df609157149acc61b8e91f146c0e2b89f7ec Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Thu, 23 May 2024 15:12:08 -0400 Subject: [PATCH 17/53] Change to token --- .github/workflows/coverage.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9e9a34dd..4ffae839 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -34,9 +34,8 @@ jobs: tox -r -e cov - name: Codecov uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: + token: ${{ secrets.CODECOV_TOKEN }} flags: unittests file: ./coverage.xml name: blinkpy From aec40c3158c723059a52427952f63c9e023469bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 18:38:56 +0000 Subject: [PATCH 18/53] Bump coverage from 7.5.1 to 7.5.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.1 to 7.5.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.1...7.5.2) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:production update-type: version-update:semver-patch ... 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 e325377c..03f9e23a 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,7 +1,7 @@ ruff==0.4.5 black==24.4.2 build==1.2.1 -coverage==7.5.1 +coverage==7.5.2 pytest==8.2.1 pytest-cov==5.0.0 pytest-sugar==1.0.0 From 0958c1d36ed430be27085f72c97feae3297770ad Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Mon, 27 May 2024 20:15:18 -0400 Subject: [PATCH 19/53] Update coverage.yml --- .github/workflows/coverage.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 4ffae839..66c9361e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -35,8 +35,9 @@ jobs: - name: Codecov uses: codecov/codecov-action@v4 with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: unittests - file: ./coverage.xml + fail_ci_if_error: true # optional (default = false) + files: ./coverage.xml + flags: unittests # optional name: blinkpy - fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} # required + verbose: true # optional (default = false) From 703a8288c11e88de19fe75f8211f836dfa4f28dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 18:41:28 +0000 Subject: [PATCH 20/53] Bump coverage from 7.5.2 to 7.5.3 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.5.2 to 7.5.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.2...7.5.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:production update-type: version-update:semver-patch ... 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 03f9e23a..35b2d2bc 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,7 +1,7 @@ ruff==0.4.5 black==24.4.2 build==1.2.1 -coverage==7.5.2 +coverage==7.5.3 pytest==8.2.1 pytest-cov==5.0.0 pytest-sugar==1.0.0 From f5d683efe0445c8c278237a54b59414ca7dd3bca Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Wed, 29 May 2024 14:59:08 -0400 Subject: [PATCH 21/53] Pin codecov version to prevent it failing --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 66c9361e..ffd82d34 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -33,7 +33,7 @@ jobs: run: | tox -r -e cov - name: Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v4.3.1 with: fail_ci_if_error: true # optional (default = false) files: ./coverage.xml From bfab0836596e925570b0ccda49ffe5f9c87f63de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 19:05:20 +0000 Subject: [PATCH 22/53] Bump ruff from 0.4.5 to 0.4.6 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.5 to 0.4.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.4.5...v0.4.6) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... 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 35b2d2bc..57f0ca02 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -ruff==0.4.5 +ruff==0.4.6 black==24.4.2 build==1.2.1 coverage==7.5.3 From 503faf7dbfe62948e8068585a1fb350b481c74b4 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Wed, 29 May 2024 15:10:56 -0400 Subject: [PATCH 23/53] Roll back codecov action to v3 --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ffd82d34..8c2f71cd 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -33,7 +33,7 @@ jobs: run: | tox -r -e cov - name: Codecov - uses: codecov/codecov-action@v4.3.1 + uses: codecov/codecov-action@v3 with: fail_ci_if_error: true # optional (default = false) files: ./coverage.xml From 9be8dd442f673f2ce1e839becdbe8373dcbdecb6 Mon Sep 17 00:00:00 2001 From: jrhunger <1101010@gmail.com> Date: Thu, 30 May 2024 20:56:03 -0400 Subject: [PATCH 24/53] update auth self.userid from login data --- blinkpy/auth.py | 1 + 1 file changed, 1 insertion(+) diff --git a/blinkpy/auth.py b/blinkpy/auth.py index 8f5a7de1..41d15046 100644 --- a/blinkpy/auth.py +++ b/blinkpy/auth.py @@ -132,6 +132,7 @@ def extract_login_info(self): self.token = self.login_response["auth"]["token"] self.client_id = self.login_response["account"]["client_id"] self.account_id = self.login_response["account"]["account_id"] + self.user_id = self.login_response["account"]["user_id"] async def startup(self): """Initialize tokens for communication.""" From de335717d65620de16af13af1444d448957eee62 Mon Sep 17 00:00:00 2001 From: jrhunger <1101010@gmail.com> Date: Thu, 30 May 2024 21:06:47 -0400 Subject: [PATCH 25/53] check for null homescreen before dereferencing for owls/lotus --- blinkpy/blinkpy.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blinkpy/blinkpy.py b/blinkpy/blinkpy.py index e46a2c56..bab54ab8 100644 --- a/blinkpy/blinkpy.py +++ b/blinkpy/blinkpy.py @@ -179,6 +179,9 @@ async def setup_owls(self): """Check for mini cameras.""" network_list = [] camera_list = [] + if self.homescreen is None: + # Don't try to iterate if homescreen is not defined + return camera_list try: for owl in self.homescreen["owls"]: name = owl["name"] @@ -203,6 +206,9 @@ async def setup_lotus(self): """Check for doorbells cameras.""" network_list = [] camera_list = [] + if self.homescreen is None: + # Don't try to iterate if homescreen is not defined + return camera_list try: for lotus in self.homescreen["doorbells"]: name = lotus["name"] From 982818a67c013bdfeef2c62ef9f632f4767ae346 Mon Sep 17 00:00:00 2001 From: jrhunger <1101010@gmail.com> Date: Thu, 30 May 2024 21:32:28 -0400 Subject: [PATCH 26/53] fix formatting --- blinkpy/blinkpy.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blinkpy/blinkpy.py b/blinkpy/blinkpy.py index bab54ab8..84862ced 100644 --- a/blinkpy/blinkpy.py +++ b/blinkpy/blinkpy.py @@ -180,8 +180,8 @@ async def setup_owls(self): network_list = [] camera_list = [] if self.homescreen is None: - # Don't try to iterate if homescreen is not defined - return camera_list + # Don't try to iterate if homescreen is not defined + return camera_list try: for owl in self.homescreen["owls"]: name = owl["name"] @@ -207,8 +207,8 @@ async def setup_lotus(self): network_list = [] camera_list = [] if self.homescreen is None: - # Don't try to iterate if homescreen is not defined - return camera_list + # Don't try to iterate if homescreen is not defined + return camera_list try: for lotus in self.homescreen["doorbells"]: name = lotus["name"] From 1b5dd181463b0db51b34583691c46a3d2b0593e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 18:17:08 +0000 Subject: [PATCH 27/53] Bump ruff from 0.4.6 to 0.4.7 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.6 to 0.4.7. - [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.4.6...v0.4.7) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... 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 57f0ca02..6259b80e 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -ruff==0.4.6 +ruff==0.4.7 black==24.4.2 build==1.2.1 coverage==7.5.3 From e6620448199bab20aed68b9fb8230877433aef9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 18:43:35 +0000 Subject: [PATCH 28/53] Bump pytest from 8.2.1 to 8.2.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.1 to 8.2.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.2.1...8.2.2) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-patch ... 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 6259b80e..04324155 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -2,7 +2,7 @@ ruff==0.4.7 black==24.4.2 build==1.2.1 coverage==7.5.3 -pytest==8.2.1 +pytest==8.2.2 pytest-cov==5.0.0 pytest-sugar==1.0.0 pytest-timeout==2.3.1 From ac63fe4724324d9fa3c5eff082eb91677e37f4d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:34:50 +0000 Subject: [PATCH 29/53] Bump ruff from 0.4.7 to 0.4.8 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.7 to 0.4.8. - [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.4.7...v0.4.8) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... 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 6259b80e..107c81b4 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -ruff==0.4.7 +ruff==0.4.8 black==24.4.2 build==1.2.1 coverage==7.5.3 From da65f3ce35658756a1c2eb3230476195fe4119db Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:29:09 -0400 Subject: [PATCH 30/53] Merge tests and coverage workflows --- .github/workflows/tests.yml | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d424c132..453e80a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: build +name: tests on: push: @@ -7,7 +7,7 @@ on: branches: [ master, dev ] jobs: - build: + pytest: runs-on: ${{ matrix.platform }} strategy: max-parallel: 4 @@ -17,7 +17,8 @@ jobs: python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - name: Check out code from GitHub + uses: actions/checkout@v4.1.6 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -31,3 +32,32 @@ jobs: - name: Tests run: | tox -r + - name: Upload coverage + uses: actions/upload-artifact$v4.3.3 + with: + name: coverage-${{ matrix.python-version }}-${{ matrix.platform }} + path: coverage.xml + overwrite: true + coverage: + runs-on: ${{ matrix.platform }} + matrix: + platform: + - ubuntu-latest + python-version: ['3.11'] + needs: + - pytest + timeout-minutes: 10 + steps: + - name: Check out code from GitHub + uses: actions/checkout@v4.1.6 + - name: Download all coverage artifacts + uses: actions/download-artifact@v4.1.7 + with: + path: coverage-${{ matrix.python-version }}-${{ matrix.platform }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4.4.1 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + name: blinkpy + From 98888c43d765ca6bc83e9618dc41bc8690ca34af Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:30:19 -0400 Subject: [PATCH 31/53] Typo fix --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 453e80a0..3564a1d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: run: | tox -r - name: Upload coverage - uses: actions/upload-artifact$v4.3.3 + uses: actions/upload-artifact@v4.3.3 with: name: coverage-${{ matrix.python-version }}-${{ matrix.platform }} path: coverage.xml From 14fb5ce54fc039c4e0446019e89cd27dd6ec5262 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:31:13 -0400 Subject: [PATCH 32/53] Fixed workflow formatting --- .github/workflows/tests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3564a1d6..7395c60f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,10 +40,11 @@ jobs: overwrite: true coverage: runs-on: ${{ matrix.platform }} - matrix: - platform: - - ubuntu-latest - python-version: ['3.11'] + strategy: + matrix: + platform: + - ubuntu-latest + python-version: ['3.11'] needs: - pytest timeout-minutes: 10 From 18d2765ead6f2105e6f602e5a80a3397974b02d4 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:40:35 -0400 Subject: [PATCH 33/53] Add gh-actions to tox --- tox.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tox.ini b/tox.ini index 6dcfbb95..3d6aa5c4 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,13 @@ envlist = build, py39, py310, py311, py312, lint skip_missing_interpreters = True skipsdist = True +[gh-actions] +python = + 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 + [testenv] setenv = LANG=en_US.UTF-8 From 3dea4e72e398db956b9f326e332cb5cb2a262540 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:41:30 -0400 Subject: [PATCH 34/53] Simplify tests workflow --- .github/workflows/tests.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7395c60f..6ffccec9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,6 @@ jobs: platform: - ubuntu-latest python-version: ['3.9', '3.10', '3.11', '3.12'] - steps: - name: Check out code from GitHub uses: actions/checkout@v4.1.6 @@ -32,33 +31,3 @@ jobs: - name: Tests run: | tox -r - - name: Upload coverage - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-${{ matrix.python-version }}-${{ matrix.platform }} - path: coverage.xml - overwrite: true - coverage: - runs-on: ${{ matrix.platform }} - strategy: - matrix: - platform: - - ubuntu-latest - python-version: ['3.11'] - needs: - - pytest - timeout-minutes: 10 - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.6 - - name: Download all coverage artifacts - uses: actions/download-artifact@v4.1.7 - with: - path: coverage-${{ matrix.python-version }}-${{ matrix.platform }} - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4.4.1 - with: - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} - name: blinkpy - From a3eb59c81f46a70c02e216ec9528f6d0e1594cd1 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:44:51 -0400 Subject: [PATCH 35/53] Use upload and download to hopefully fix coverage stupidity --- .github/workflows/coverage.yml | 55 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8c2f71cd..81f1b4cf 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -8,36 +8,39 @@ on: jobs: coverage: - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest strategy: - max-parallel: 1 matrix: - platform: - - ubuntu-latest python-version: ['3.11'] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements_test.txt - pip install tox - pip install codecov - - name: Test + - name: Run Coverage run: | tox -r -e cov - - name: Codecov - uses: codecov/codecov-action@v3 + - name: Upload coverage + uses: actions/upload-artifact@v4.3.3 with: - fail_ci_if_error: true # optional (default = false) - files: ./coverage.xml - flags: unittests # optional - name: blinkpy - token: ${{ secrets.CODECOV_TOKEN }} # required - verbose: true # optional (default = false) + name: coverage-${{ matrix.python-version }} + path: coverage.xml + overwrite: true + upload-coverage: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.11'] + needs: + - coverage + timeout-minutes: 10 + steps: + - name: Check out code from GitHub + uses: actions/checkout@v4.1.6 + - name: Download all coverage artifacts + uses: actions/download-artifact@v4.1.7 + with: + name: coverage-${{ matrix.python-version }} + path: coverage.xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4.4.1 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + name: blinkpy From dd578c9f66e4dc0ed0581058353751df36b917e0 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:46:30 -0400 Subject: [PATCH 36/53] Add dependency install --- .github/workflows/coverage.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 81f1b4cf..e42f49f8 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -13,6 +13,18 @@ jobs: matrix: python-version: ['3.11'] steps: + - name: Check out code from GitHub + uses: actions/checkout@v4.1.6 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements_test.txt + pip install tox - name: Run Coverage run: | tox -r -e cov From c4c70e5c6f760f6ee6701d29d05007bab89f8e5e Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:46:57 -0400 Subject: [PATCH 37/53] Install tox-gh-actions --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6ffccec9..ed88a3b2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements_test.txt - pip install tox + pip install tox tox-gh-actions - name: Tests run: | tox -r From 79d7fd5bacd1ee180ecc2dbeb560ec370adddca2 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:55:11 -0400 Subject: [PATCH 38/53] Remove tox requirement --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ed88a3b2..1f864a18 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,6 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements_test.txt - pip install tox tox-gh-actions - name: Tests run: | - tox -r + pytest --timeout=30 --durations=10 --cov=blinkpy --cov-report term-missing From 33f1c318f0fb9d24f2f74c919c21768d31cabce7 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:56:33 -0400 Subject: [PATCH 39/53] remove gh-actions --- tox.ini | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tox.ini b/tox.ini index 3d6aa5c4..6dcfbb95 100644 --- a/tox.ini +++ b/tox.ini @@ -3,13 +3,6 @@ envlist = build, py39, py310, py311, py312, lint skip_missing_interpreters = True skipsdist = True -[gh-actions] -python = - 3.9: py39 - 3.10: py310 - 3.11: py311 - 3.12: py312 - [testenv] setenv = LANG=en_US.UTF-8 From 899442b86f9bce448595fefcd12e2b3c0b618715 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:57:28 -0400 Subject: [PATCH 40/53] Remove tox requirement --- .github/workflows/lint.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index da2d3818..54b5db60 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,13 +8,13 @@ on: branches: [ master, dev ] pull_request: branches: [ master, dev ] - jobs: lint: runs-on: ubuntu-latest strategy: + max-parallel: 2 matrix: - python-version: [3.11] + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 @@ -27,7 +27,8 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements_test.txt - pip install tox - name: Lint run: | - tox -r -e lint + ruff check blinkpy tests blinkapp + black --check --color --diff blinkpy tests blinkapp + rst-lint README.rst CHANGES.rst CONTRIBUTING.rst From 734f99e03e20079663497ec07176116e2f7924c0 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:59:42 -0400 Subject: [PATCH 41/53] Actions checkout v3 downgrade --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1f864a18..cfe86d61 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - name: Check out code from GitHub - uses: actions/checkout@v4.1.6 + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From 5e370f3233c7cace1ced3884ea03f0a1f04e1ce1 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 15:01:07 -0400 Subject: [PATCH 42/53] Breakout linting commands --- .github/workflows/lint.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 54b5db60..79ca3f8c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,8 +27,12 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements_test.txt - - name: Lint + - name: Ruff run: | ruff check blinkpy tests blinkapp + - name: Black + run: | black --check --color --diff blinkpy tests blinkapp + - name: RST-Lint + run: | rst-lint README.rst CHANGES.rst CONTRIBUTING.rst From b2a7c8279c6d491f0af624e6dbc3340e65524983 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 15:04:45 -0400 Subject: [PATCH 43/53] Create build.yml --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..9b45cd3a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: build + +on: + push: + branches: [ master, dev ] + pull_request: + branches: [ master, dev ] + +jobs: + build: + runs-on: ${{ matrix.platform }} + strategy: + matrix: + platform: + - ubuntu-latest + python-version: ['3.11'] + steps: + - name: Check out code from GitHub + uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements_test.txt + pip install tox + - name: Build Wheel + run: | + tox -r -e build From 0aa0a13254a73dfb76165bcbf63bb5c82f60fb45 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 15:22:57 -0400 Subject: [PATCH 44/53] Use python -m to call pytest --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cfe86d61..69a4bd20 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,4 +29,8 @@ jobs: pip install -r requirements_test.txt - name: Tests run: | - pytest --timeout=30 --durations=10 --cov=blinkpy --cov-report term-missing + python -m pytest \ + --timeout=30 \ + --durations=10 \ + --cov=blinkpy \ + --cov-report term-missing From badec59c98024875292de1a16036b58ea6c729c9 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 17:18:35 -0400 Subject: [PATCH 45/53] Install blinkpy before running tests --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 69a4bd20..fad0f0ce 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,6 +27,7 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements_test.txt + pip install . - name: Tests run: | python -m pytest \ From d60076cae62547b811963c3085865692d1f2e73d Mon Sep 17 00:00:00 2001 From: jrhunger <1101010@gmail.com> Date: Fri, 7 Jun 2024 22:22:48 -0400 Subject: [PATCH 46/53] incorporate review feedback --- blinkpy/auth.py | 2 +- blinkpy/blinkpy.py | 10 ++-------- tests/test_auth.py | 1 + 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/blinkpy/auth.py b/blinkpy/auth.py index 41d15046..59967f63 100644 --- a/blinkpy/auth.py +++ b/blinkpy/auth.py @@ -132,7 +132,7 @@ def extract_login_info(self): self.token = self.login_response["auth"]["token"] self.client_id = self.login_response["account"]["client_id"] self.account_id = self.login_response["account"]["account_id"] - self.user_id = self.login_response["account"]["user_id"] + self.user_id = self.login_response["account"].get("user_id", None) async def startup(self): """Initialize tokens for communication.""" diff --git a/blinkpy/blinkpy.py b/blinkpy/blinkpy.py index 84862ced..aa5be02b 100644 --- a/blinkpy/blinkpy.py +++ b/blinkpy/blinkpy.py @@ -179,9 +179,6 @@ async def setup_owls(self): """Check for mini cameras.""" network_list = [] camera_list = [] - if self.homescreen is None: - # Don't try to iterate if homescreen is not defined - return camera_list try: for owl in self.homescreen["owls"]: name = owl["name"] @@ -195,7 +192,7 @@ async def setup_owls(self): network_list.append(str(network_id)) self.sync[name] = BlinkOwl(self, name, network_id, owl) await self.sync[name].start() - except KeyError: + except (KeyError, TypeError): # No sync-less devices found pass @@ -206,9 +203,6 @@ async def setup_lotus(self): """Check for doorbells cameras.""" network_list = [] camera_list = [] - if self.homescreen is None: - # Don't try to iterate if homescreen is not defined - return camera_list try: for lotus in self.homescreen["doorbells"]: name = lotus["name"] @@ -228,7 +222,7 @@ async def setup_lotus(self): network_list.append(str(network_id)) self.sync[name] = BlinkLotus(self, name, network_id, lotus) await self.sync[name].start() - except KeyError: + except (KeyError, TypeError): # No sync-less devices found pass diff --git a/tests/test_auth.py b/tests/test_auth.py index 0d6168e9..b0f5122f 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -167,6 +167,7 @@ async def test_refresh_token(self, mock_resp): self.assertEqual(self.auth.token, "foobar") self.assertEqual(self.auth.client_id, 1234) self.assertEqual(self.auth.account_id, 5678) + self.assertEqual(self.auth.user_id, None) mock_resp.return_value.status = 400 with self.assertRaises(TokenRefreshFailed): From 23f450d17ead23d8315314e233c90147d5f9fe69 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Sun, 9 Jun 2024 20:50:22 +0200 Subject: [PATCH 47/53] Fix clip recording for Blink Mini and Doorbell camera models Add missing camera model specific API service URLs. --- blinkpy/camera.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/blinkpy/camera.py b/blinkpy/camera.py index 39a134fb..b3c4a4b7 100644 --- a/blinkpy/camera.py +++ b/blinkpy/camera.py @@ -516,6 +516,17 @@ async def async_arm(self, value): await api.wait_for_command(self.sync.blink, response) return response + async def record(self): + """Initiate clip recording for a blink mini camera.""" + url = ( + f"{self.sync.urls.base_url}/api/v1/accounts/" + f"{self.sync.blink.account_id}/networks/" + f"{self.network_id}/owls/{self.camera_id}/clip" + ) + response = await api.http_post(self.sync.blink, url) + await api.wait_for_command(self.sync.blink, response) + return response + async def snap_picture(self): """Snap picture for a blink mini camera.""" url = ( @@ -575,6 +586,18 @@ async def async_arm(self, value): await api.wait_for_command(self.sync.blink, response) return response + async def record(self): + """Initiate clip recording for a blink doorbell camera.""" + url = ( + f"{self.sync.urls.base_url}/api/v1/accounts/" + f"{self.sync.blink.account_id}/networks/" + f"{self.sync.network_id}/doorbells/{self.camera_id}/clip" + ) + + response = await api.http_post(self.sync.blink, url) + await api.wait_for_command(self.sync.blink, response) + return response + async def snap_picture(self): """Snap picture for a blink doorbell camera.""" url = ( From 69e0165aba79eb4ab71fa8d017eea75397aea487 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Sun, 9 Jun 2024 20:48:19 +0200 Subject: [PATCH 48/53] Add another get_homescreen() call after 2fa verification Follow up to #941 as discussed in #917 to fix missing owls/lotus. --- blinkpy/blinkpy.py | 2 ++ tests/test_blinkpy.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/blinkpy/blinkpy.py b/blinkpy/blinkpy.py index aa5be02b..dc031ac5 100644 --- a/blinkpy/blinkpy.py +++ b/blinkpy/blinkpy.py @@ -144,6 +144,8 @@ async def setup_prompt_2fa(self): async def setup_post_verify(self): """Initialize blink system after verification.""" try: + if not self.homescreen: + await self.get_homescreen() await self.setup_networks() networks = self.setup_network_ids() cameras = await self.setup_camera_list() diff --git a/tests/test_blinkpy.py b/tests/test_blinkpy.py index 9c01eb04..4caa81f1 100644 --- a/tests/test_blinkpy.py +++ b/tests/test_blinkpy.py @@ -192,12 +192,13 @@ async def test_setup_prompt_2fa(self, mock_key): self.assertTrue(self.blink.key_required) @mock.patch("blinkpy.blinkpy.Blink.setup_camera_list") + @mock.patch("blinkpy.api.request_homescreen") @mock.patch("blinkpy.api.request_networks") @mock.patch("blinkpy.blinkpy.Blink.setup_owls") @mock.patch("blinkpy.blinkpy.Blink.setup_lotus") @mock.patch("blinkpy.blinkpy.BlinkSyncModule.start") async def test_setup_post_verify( - self, mock_sync, mock_lotus, mock_owl, mock_networks, mock_camera + self, mock_sync, mock_lotus, mock_owl, mock_networks, mock_home, mock_camera ): """Test setup after verification.""" self.blink.available = False @@ -214,16 +215,19 @@ async def test_setup_post_verify( mock_networks.return_value = { "summary": {"foo": {"onboarded": True, "name": "bar"}} } + mock_home.return_value = {} mock_camera.return_value = [] self.assertTrue(await self.blink.setup_post_verify()) self.assertTrue(self.blink.available) self.assertFalse(self.blink.key_required) + @mock.patch("blinkpy.api.request_homescreen") @mock.patch("blinkpy.api.request_networks") - async def test_setup_post_verify_failure(self, mock_networks): + async def test_setup_post_verify_failure(self, mock_networks, mock_home): """Test failed setup after verification.""" self.blink.available = False mock_networks.return_value = {} + mock_home.return_value = {} self.assertFalse(await self.blink.setup_post_verify()) self.assertFalse(self.blink.available) From e1ee300219dc2baff582993a4cb476f84eda9ffc Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Sun, 9 Jun 2024 15:38:49 -0400 Subject: [PATCH 49/53] Beta version bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a8885ec2..1f4e3733 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "blinkpy" -version = "0.23.0b7" +version = "0.23.0b8" license = {text = "MIT"} description = "A Blink camera Python Library." readme = "README.rst" From 325f311b2a8fadf4d7edaa53d61ce8f6b3163fef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:34:34 +0000 Subject: [PATCH 50/53] Bump ruff from 0.4.8 to 0.4.9 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.8 to 0.4.9. - [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.4.8...v0.4.9) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... 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 1b476ca1..70e43dd5 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -ruff==0.4.8 +ruff==0.4.9 black==24.4.2 build==1.2.1 coverage==7.5.3 From e56b6751f8482653dcd8b1032cb588200e469639 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Wed, 19 Jun 2024 15:55:58 -0400 Subject: [PATCH 51/53] Added ability to get and set notification flags --- blinkpy/api.py | 32 ++++++++++++++++++++++++++++++++ blinkpy/blinkpy.py | 15 +++++++++++++++ tests/test_api.py | 17 +++++++++++++++++ tests/test_blink_functions.py | 18 ++++++++++++++++++ 4 files changed, 82 insertions(+) diff --git a/blinkpy/api.py b/blinkpy/api.py index c4121248..95dc280b 100644 --- a/blinkpy/api.py +++ b/blinkpy/api.py @@ -166,6 +166,38 @@ async def request_system_disarm(blink, network, **kwargs): return response +async def request_notification_flags(blink, **kwargs): + """ + Get system notification flags. + + :param blink: Blink instance. + """ + url = ( + f"{blink.urls.base_url}/api/v1/accounts/{blink.account_id}" + "/notifications/configuration" + ) + response = await http_get(blink, url) + await wait_for_command(blink, response) + return response + + +async def request_set_notification_flag(blink, data_dict): + """ + Set a system notification flag. + + :param blink: Blink instance. + :param data_dict: Dictionary of notifications to set. + """ + url = ( + f"{blink.urls.base_url}/api/v1/accounts/{blink.account_id}" + "/notifications/configuration" + ) + data = dumps({"notifications": data_dict}) + response = await http_post(blink, url, data=data, json=False) + await wait_for_command(blink, response) + return response + + async def request_command_status(blink, network, command_id): """ Request command status. diff --git a/blinkpy/blinkpy.py b/blinkpy/blinkpy.py index dc031ac5..80ea937b 100644 --- a/blinkpy/blinkpy.py +++ b/blinkpy/blinkpy.py @@ -320,6 +320,21 @@ async def save(self, file_name): """Save login data to file.""" await util.json_save(self.auth.login_attributes, file_name) + async def get_status(self): + """Get the blink system notification status.""" + response = await api.request_notification_flags(self) + return response.get("notifications", response) + + async def set_status(self, data_dict={}): + """ + Set the blink system notification status. + + :param data_dict: Dictionary of notification keys to modify. + Example: {'low_battery': False, 'motion': False} + """ + response = await api.request_set_notification_flag(self, data_dict) + return response + async def download_videos( self, path, since=None, camera="all", stop=10, delay=1, debug=False ): diff --git a/tests/test_api.py b/tests/test_api.py index 2b3a850d..89581dbc 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -106,6 +106,23 @@ async def test_request_camera_usage(self, mock_resp): await api.request_camera_usage(self.blink), {"cameras": "1111"} ) + async def test_request_notification_flags(self, mock_resp): + """Test notification flag request.""" + mock_resp.return_value = {"notifications": {"some_key": False}} + self.assertEqual( + await api.request_notification_flags(self.blink), + {"notifications": {"some_key": False}}, + ) + + async def test_request_set_notification_flag(self, mock_resp): + """Test set of notifiaction flags.""" + mock_resp.side_effect = ( + mresp.MockResponse(COMMAND_RESPONSE, 200), + COMMAND_COMPLETE, + ) + response = await api.request_set_notification_flag(self.blink, {}) + self.assertEqual(response.status, 200) + async def test_request_motion_detection_enable(self, mock_resp): """Test Motion detect enable.""" mock_resp.side_effect = ( diff --git a/tests/test_blink_functions.py b/tests/test_blink_functions.py index eedebfd3..35477a71 100644 --- a/tests/test_blink_functions.py +++ b/tests/test_blink_functions.py @@ -278,3 +278,21 @@ async def test_refresh(self, mock_req, mock_update): self.blink.cameras = {"bar": MockCamera(self.blink.sync)} self.blink.sync["foo"].cameras = self.blink.cameras self.assertTrue(await self.blink.refresh()) + + @mock.patch("blinkpy.blinkpy.api.request_notification_flags") + async def test_get_status(self, mock_req): + """Test get of notification flags.""" + mock_req.return_value = {"notifications": {"foo": True}} + self.assertDictEqual(await self.blink.get_status(), {"foo": True}) + + @mock.patch("blinkpy.blinkpy.api.request_notification_flags") + async def test_get_status_malformed(self, mock_req): + """Test get of notification flags with malformed response.""" + mock_req.return_value = {"nobueno": {"foo": False}} + self.assertDictEqual(await self.blink.get_status(), {"nobueno": {"foo": False}}) + + @mock.patch("blinkpy.blinkpy.api.request_set_notification_flag") + async def test_set_status(self, mock_req): + """Test set of notification flags.""" + mock_req.return_value = True + self.assertTrue(await self.blink.set_status()) From ba397852fceb85013eb3e54c5511ca61b07f3099 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Wed, 19 Jun 2024 15:59:59 -0400 Subject: [PATCH 52/53] Version bump for release --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1f4e3733..57633569 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "blinkpy" -version = "0.23.0b8" +version = "0.23.0" license = {text = "MIT"} description = "A Blink camera Python Library." readme = "README.rst" From b8194fa94014842052bdd207a3b5043804a5c2b1 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Wed, 19 Jun 2024 16:01:25 -0400 Subject: [PATCH 53/53] Update CHANGES.rst --- CHANGES.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 35dc28cc..2acb121b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,12 @@ Changelog A list of changes between each release +0.23.0 (2024-06-19) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +See release notes: (`0.23.0 `__) + + 0.22.7 (2024-04-15) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~