Compare commits

..
Author SHA1 Message Date
Kevin FronczakandGitHub 6fa4aa6f75 Merge pull request #425 from fronzbot/0.16.5.rc0
0.16.5.rc0
2021-02-05 10:24:00 -05:00
Kevin FronczakandGitHub 89da167404 Update constants.py 2021-02-05 10:22:04 -05:00
Kevin FronczakandGitHub f2520e35fe Merge pull request #424 from fronzbot/fix-vid-download
Add content type to header to fix downloading
2021-02-05 10:21:10 -05:00
Kevin Fronczak aaaaea4dd1 Fix header test 2021-02-05 15:18:09 +00:00
Kevin Fronczak ec67d97809 Add content type to header to fix downloading 2021-02-05 15:11:03 +00:00
Kevin FronczakandGitHub f6118ea4a7 Merge pull request #420 from fronzbot/dependabot/pip/coverage-5.4
Bump coverage from 5.3.1 to 5.4
2021-01-27 07:37:23 -05:00
dependabot-preview[bot]andGitHub d257f676ec Bump coverage from 5.3.1 to 5.4
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.3.1 to 5.4.
- [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/coverage-5.3.1...coverage-5.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-27 06:09:36 +00:00
Kevin FronczakandGitHub 58f4a9df57 Merge pull request #419 from fronzbot/dependabot/pip/pytest-6.2.2
Bump pytest from 6.2.1 to 6.2.2
2021-01-26 08:10:02 -05:00
dependabot-preview[bot]andGitHub 9d91ce62d3 Bump pytest from 6.2.1 to 6.2.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.1...6.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-26 06:06:01 +00:00
Kevin FronczakandGitHub 511ca99cba Merge pull request #416 from fronzbot/dependabot/pip/pytest-cov-2.11.1
Bump pytest-cov from 2.11.0 to 2.11.1
2021-01-21 09:04:52 -05:00
dependabot-preview[bot]andGitHub 465701810b Bump pytest-cov from 2.11.0 to 2.11.1
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.11.0 to 2.11.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.11.0...v2.11.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-21 06:06:32 +00:00
Kevin FronczakandGitHub c8c0ed58df Merge pull request #415 from fronzbot/dependabot/pip/pytest-cov-2.11.0
Bump pytest-cov from 2.10.1 to 2.11.0
2021-01-19 07:30:16 -05:00
dependabot-preview[bot]andGitHub cfe3c10cec Bump pytest-cov from 2.10.1 to 2.11.0
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.10.1...v2.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-19 06:06:21 +00:00
Kevin FronczakandGitHub 014509bd64 Merge pull request #414 from fronzbot/dependabot/pip/pygments-2.7.4
Bump pygments from 2.7.3 to 2.7.4
2021-01-13 07:53:07 -05:00
dependabot-preview[bot]andGitHub f5d5d34eda Bump pygments from 2.7.3 to 2.7.4
Bumps [pygments](https://github.com/pygments/pygments) from 2.7.3 to 2.7.4.
- [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.7.3...2.7.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-13 06:12:31 +00:00
Kevin FronczakandGitHub 64c8bec614 Merge pull request #405 from fronzbot/dependabot/pip/restructuredtext-lint-1.3.2
Bump restructuredtext-lint from 1.3.1 to 1.3.2
2021-01-05 09:43:00 -05:00
Kevin FronczakandGitHub 1b765035de Merge pull request #408 from fronzbot/dependabot/pip/pre-commit-2.9.3
Bump pre-commit from 2.7.1 to 2.9.3
2021-01-05 09:42:48 -05:00
dependabot-preview[bot]andGitHub 93f46bde6a Bump restructuredtext-lint from 1.3.1 to 1.3.2
Bumps [restructuredtext-lint](https://github.com/twolfson/restructuredtext-lint) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/twolfson/restructuredtext-lint/releases)
- [Changelog](https://github.com/twolfson/restructuredtext-lint/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/twolfson/restructuredtext-lint/compare/1.3.1...1.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 14:37:34 +00:00
dependabot-preview[bot]andGitHub 4a09fcf06f Bump pre-commit from 2.7.1 to 2.9.3
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.7.1 to 2.9.3.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.7.1...v2.9.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 14:36:38 +00:00
Kevin FronczakandGitHub 12a2ae1326 Merge pull request #407 from fronzbot/dependabot/pip/pygments-2.7.3
Bump pygments from 2.7.1 to 2.7.3
2021-01-05 09:36:22 -05:00
Kevin FronczakandGitHub 325241d56a Merge pull request #411 from fronzbot/dependabot/pip/coverage-5.3.1
Bump coverage from 5.3 to 5.3.1
2021-01-05 09:36:04 -05:00
Kevin FronczakandGitHub 95664fea1f Merge pull request #410 from fronzbot/dependabot/pip/pytest-6.2.1
Bump pytest from 6.1.1 to 6.2.1
2021-01-05 09:35:22 -05:00
dependabot-preview[bot]andGitHub e2b43f4b06 Bump pytest from 6.1.1 to 6.2.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.1 to 6.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.1.1...6.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-05 14:29:23 +00:00
Kevin FronczakandGitHub 845c8a2a40 Merge pull request #413 from fronzbot/add-py39
Add py39
2021-01-05 09:27:31 -05:00
Kevin FronczakandGitHub 306f8b6cb4 Update tests.yml 2021-01-05 09:24:04 -05:00
Kevin FronczakandGitHub a704933a35 Update publish.yml 2021-01-05 09:23:29 -05:00
Kevin FronczakandGitHub 8bd09c3726 Delete .gitlab-ci.yml 2021-01-05 09:22:04 -05:00
Kevin FronczakandGitHub 6240364067 Update constants.py 2021-01-05 09:21:36 -05:00
Kevin FronczakandGitHub 9d37cfccd0 Update stale.yml 2021-01-05 09:12:56 -05:00
dependabot-preview[bot]andGitHub 125efd9436 Bump coverage from 5.3 to 5.3.1
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.3 to 5.3.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/coverage-5.3...coverage-5.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-21 06:32:59 +00:00
dependabot-preview[bot]andGitHub 6701fd39d8 Bump pygments from 2.7.1 to 2.7.3
Bumps [pygments](https://github.com/pygments/pygments) from 2.7.1 to 2.7.3.
- [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.7.1...2.7.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-07 06:18:02 +00:00
Kevin Fronczak d4edf96f83 Dev version bump 2020-11-23 04:34:49 +00:00
Kevin FronczakandGitHub a2555a6c40 Update for 0.16.4 2020-11-22 23:31:13 -05:00
Kevin Fronczak c01a6ce16b dev version bump 2020-11-23 04:25:16 +00:00
Kevin Fronczak ab38afa105 dev version bump 2020-11-23 04:06:19 +00:00
Kevin FronczakandGitHub ba3c2e3489 Merge pull request #401 from fronzbot/fix-exception-on-refresh
Added test to catch NoneType error on refresh, fixed offending code
2020-11-22 23:04:31 -05:00
Kevin Fronczak 92a2cc2d9a Added test to catch NoneType error on refresh, fixed offending code 2020-11-23 03:30:15 +00:00
Kevin FronczakandGitHub 0842739197 Merge pull request #395 from fronzbot/fix-stream-format
Fix malformatted stream url for blink mini
2020-10-25 10:09:28 -04:00
Kevin Fronczak f09a66c083 Fix malformatted stream url for blink mini 2020-10-25 14:01:03 +00:00
Kevin FronczakandGitHub 88984365fe Update constants.py 2020-10-06 09:31:45 -04:00
Kevin FronczakandGitHub 469b0c257e Merge pull request #389 from fronzbot/fix-liveview-endpoint
Updated liveview endpoint
2020-10-06 09:29:17 -04:00
Kevin FronczakandGitHub a94f59eb53 Merge pull request #388 from fronzbot/fix-mini-thumb-refresh
Generalized image/video download, fixed non-updating image for minis
2020-10-06 09:23:55 -04:00
Kevin Fronczak eb1fbe90d1 Updated liveview endpoint 2020-10-06 13:20:56 +00:00
Kevin Fronczak b5b7498041 Generalized image/video download, fixed non-updating image for minis 2020-10-06 13:16:05 +00:00
Kevin FronczakandGitHub 828b41197b Merge pull request #387 from fronzbot/move-testtools
Move testtools to requirements_test.txt
2020-10-05 16:33:14 -04:00
Kevin Fronczak b0fed670b9 Move testtools to requirements_test.txt 2020-10-05 20:29:13 +00:00
Kevin FronczakandGitHub f13d177615 Merge pull request #371 from fronzbot/dependabot/pip/pre-commit-2.7.1
Bump pre-commit from 2.6.0 to 2.7.1
2020-10-05 09:53:56 -04:00
Kevin FronczakandGitHub fcce28c9c4 Merge pull request #385 from fronzbot/dependabot/pip/pytest-6.1.1
Bump pytest from 6.0.1 to 6.1.1
2020-10-05 09:53:44 -04:00
Kevin FronczakandGitHub e8e9d4e3cd Update .pre-commit-config.yaml 2020-10-05 09:49:16 -04:00
dependabot-preview[bot]andGitHub 59ef398452 Bump pytest from 6.0.1 to 6.1.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.1 to 6.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.0.1...6.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-05 13:49:12 +00:00
Kevin FronczakandGitHub 80e39845ce Merge pull request #375 from fronzbot/dependabot/pip/pydocstyle-5.1.1
Bump pydocstyle from 5.0.2 to 5.1.1
2020-10-05 09:47:58 -04:00
Kevin FronczakandGitHub cbab673084 Merge pull request #384 from fronzbot/dependabot/pip/flake8-3.8.4
Bump flake8 from 3.8.3 to 3.8.4
2020-10-05 09:47:44 -04:00
Kevin FronczakandGitHub f27df12e64 Merge pull request #379 from fronzbot/dependabot/pip/pygments-2.7.1
Bump pygments from 2.6.1 to 2.7.1
2020-10-05 09:46:08 -04:00
dependabot-preview[bot]andGitHub bdcb3f6203 Bump pydocstyle from 5.0.2 to 5.1.1
Bumps [pydocstyle](https://github.com/PyCQA/pydocstyle) from 5.0.2 to 5.1.1.
- [Release notes](https://github.com/PyCQA/pydocstyle/releases)
- [Changelog](https://github.com/PyCQA/pydocstyle/blob/master/docs/release_notes.rst)
- [Commits](https://github.com/PyCQA/pydocstyle/compare/5.0.2...5.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-05 13:44:53 +00:00
dependabot-preview[bot]andGitHub f619b20e2a Bump flake8 from 3.8.3 to 3.8.4
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.3 to 3.8.4.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.3...3.8.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-05 13:44:52 +00:00
Kevin FronczakandGitHub 69aaee3fc4 Merge branch 'dev' into dependabot/pip/pre-commit-2.7.1 2020-10-05 09:44:28 -04:00
Kevin FronczakandGitHub 7140895c58 Merge pull request #370 from fronzbot/dependabot/pip/pylint-2.6.0
Bump pylint from 2.5.3 to 2.6.0
2020-10-05 09:43:33 -04:00
Kevin FronczakandGitHub 190cef875e Attempt to fix coverage 2020-10-05 09:38:15 -04:00
dependabot-preview[bot]andGitHub 7aef8570a5 Bump pylint from 2.5.3 to 2.6.0
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.5.3 to 2.6.0.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.5.3...pylint-2.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-05 13:24:47 +00:00
Kevin FronczakandGitHub 721a3ad8f2 Merge pull request #386 from fronzbot/add-codecov-token
Add codecov token to workflow to fix upload issue
2020-10-05 09:21:31 -04:00
Kevin FronczakandGitHub 1b1c30bff0 Add codecov token to workflow to fix upload issue 2020-10-05 09:08:15 -04:00
dependabot-preview[bot]andGitHub 8c23087f89 Bump pre-commit from 2.6.0 to 2.7.1
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.6.0 to 2.7.1.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v2.6.0...v2.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-28 15:10:49 +00:00
Kevin FronczakandGitHub dae2413ed1 Merge pull request #381 from rohitsud/patch-1
Fix readme param and spelling
2020-09-28 11:10:32 -04:00
Kevin FronczakandGitHub cd9792193f Merge pull request #377 from fronzbot/dependabot/pip/coverage-5.3
Bump coverage from 5.2.1 to 5.3
2020-09-28 11:09:35 -04:00
Kevin FronczakandGitHub 75dbd1e498 Merge pull request #368 from fronzbot/dependabot/pip/pytest-cov-2.10.1
Bump pytest-cov from 2.10.0 to 2.10.1
2020-09-27 21:59:53 -04:00
rohitsudandGitHub a374009835 Fix readme param and spelling 2020-09-27 13:06:24 -07:00
dependabot-preview[bot]andGitHub 9a9501635f Bump pygments from 2.6.1 to 2.7.1
Bumps [pygments](https://github.com/pygments/pygments) from 2.6.1 to 2.7.1.
- [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.6.1...2.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-18 06:32:37 +00:00
dependabot-preview[bot]andGitHub e00600c955 Bump coverage from 5.2.1 to 5.3
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.2.1 to 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/coverage-5.2.1...coverage-5.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-14 06:38:09 +00:00
dependabot-preview[bot]andGitHub 141fea542c Bump pytest-cov from 2.10.0 to 2.10.1
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.10.0 to 2.10.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.10.0...v2.10.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-17 08:14:22 +00:00
Kevin Fronczak ed4450778d Dev bump 2020-08-02 03:35:42 +00:00
Kevin FronczakandGitHub 41d59b1df0 Merge pull request #362 from fronzbot/update-changelog
Update changelog for 0.16.3
2020-08-01 23:29:04 -04:00
Kevin FronczakandGitHub fd104c09da Merge pull request #361 from fronzbot/add-user-agent-everywhere
Add user agent to all headers
2020-08-01 23:28:54 -04:00
Kevin Fronczak 6dbed91426 Update changelog for 0.16.3 2020-08-02 03:24:38 +00:00
Kevin Fronczak cb43f17d75 Add user agent to all headers 2020-08-02 03:22:49 +00:00
Kevin FronczakandGitHub 5ebf278ad3 Merge pull request #360 from fronzbot/dev-bump
Dev version bump
2020-08-01 23:13:46 -04:00
Kevin Fronczak 7f782533b8 Dev version bump 2020-08-02 03:09:22 +00:00
Kevin FronczakandGitHub 1790c1beae Merge pull request #358 from fronzbot/bugfix-version-bump
Version bump
2020-08-01 23:07:58 -04:00
Kevin Fronczak 09e1c382d3 Version bump 2020-08-02 03:04:09 +00:00
Kevin FronczakandGitHub ceb2270ee5 Merge pull request #357 from fronzbot/simplify-login
Updated headers to include user-agent, removed extra data at login
2020-08-01 23:01:34 -04:00
Kevin Fronczak 986a3c81f3 Updated headers to include user-agent, removed extra data at login 2020-08-02 02:57:26 +00:00
20 changed files with 157 additions and 105 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
@@ -8,7 +8,8 @@ daysUntilClose: 7
exemptLabels:
- Priority
- bug
- Help Wanted
- help wanted
- feature request
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: true
+2 -1
View File
@@ -33,8 +33,9 @@ jobs:
run: |
tox -r -e cov
- name: Codecov
uses: codecov/codecov-action@v1.0.6
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
file: ./coverage.xml
name: blinkpy
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
+2 -2
View File
@@ -10,11 +10,11 @@ jobs:
build:
runs-on: ${{ matrix.platform }}
strategy:
max-parallel: 3
max-parallel: 4
matrix:
platform:
- ubuntu-latest
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
-25
View File
@@ -1,25 +0,0 @@
image: python
stages:
- test
before_script:
- curl -O https://bootstrap.pypa.io/get-pip.py
- python get-pip.py
- pip install tox
python35:
image: python:3.5
stage: test
script: tox -e py35
python36:
image: python:3.6
stage: test
script: tox -e py36
lint:
image: python:3.6
stage: test
script: tox -e lint
+2 -2
View File
@@ -8,12 +8,12 @@ repos:
- --quiet
files: ^((blinkpy|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.2
rev: 3.8.3
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==5.0.2
- pydocstyle==5.1.1
files: ^(blinkpy|tests)/.+\.py$
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
rev: v1.0.0
+39 -1
View File
@@ -4,10 +4,48 @@ Changelog
A list of changes between each release
0.16.4 (2020-11-22)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**Bugfixes:**
- Updated liveview endpoint (`#389 <https://github.com/fronzbot/blinkpy/pull/389>`__)
- Fixed mini thumbnail not updating (`#388 <https://github.com/fronzbot/blinkpy/pull/388>`__)
- Add exception catch to prevent NoneType error on refresh, added test to check behavior as well (`#401 <https://github.com/fronzbot/blinkpy/pull/401>`__)
- Unrelated: had to add two force methods to refresh for testing purposes. Should not change normal usage.
- Fix malformed stream url (`#395 <https://github.com/fronzbot/blinkpy/pull/395>`__)
**All:**
- Moved testtools to requirements_test.txt (`#387 <https://github.com/fronzbot/blinkpy/pull/387>`__)
- Bumped pytest to 6.1.1
- Bumped flake8 to 3.8.4
- Fixed README spelling ((`#381 <https://github.com/fronzbot/blinkpy/pull/381>`__) via @rohitsud)
- Bumped pygments to 2.7.1
- Bumped coverage to 5.3
- Bumped pydocstyle to 5.1.1
- Bumped pre-commit to 2.7.1
- Bumped pylint to 2.6.0
- Bumped pytest-cov to 2.10.1
0.16.3 (2020-08-02)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Add user-agent to all headers
0.16.2 (2020-08-01)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Add user-agent to header at login
- Remove extra data parameters at login (not-needed)
- Bump pytest to 6.0.1
0.16.1 (2020-07-29)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Unpin requeirements, set minimum version instead
- Unpin requirements, set minimum version instead
- Bump coverage to 5.2.1
- Bump pytest to 6.0.0
+1 -1
View File
@@ -174,7 +174,7 @@ Similar methods exist for individual cameras:
Download videos
----------------
You can also use this library to download all videos from the server. In order to do this, you must specify a ``path``. You may also specifiy a how far back in time to go to retrieve videos via the ``since=`` variable (a simple string such as ``"2017/09/21"`` is sufficient), as well as how many pages to traverse via the ``page=`` variable. Note that by default, the library will search the first ten pages which is sufficient in most use cases. Additionally, you can specidy one or more cameras via the ``camera=`` property. This can be a single string indicating the name of the camera, or a list of camera names. By default, it is set to the string ``'all'`` to grab videos from all cameras.
You can also use this library to download all videos from the server. In order to do this, you must specify a ``path``. You may also specifiy a how far back in time to go to retrieve videos via the ``since=`` variable (a simple string such as ``"2017/09/21"`` is sufficient), as well as how many pages to traverse via the ``stop=`` variable. Note that by default, the library will search the first ten pages which is sufficient in most use cases. Additionally, you can specify one or more cameras via the ``camera=`` property. This can be a single string indicating the name of the camera, or a list of camera names. By default, it is set to the string ``'all'`` to grab videos from all cameras.
Example usage, which downloads all videos recorded since July 4th, 2018 at 9:34am to the ``/home/blink`` directory:
+10 -9
View File
@@ -3,7 +3,7 @@
import logging
from json import dumps
from blinkpy.helpers.util import get_time, Throttle
from blinkpy.helpers.constants import DEFAULT_URL, TIMEOUT
from blinkpy.helpers.constants import DEFAULT_URL, TIMEOUT, DEFAULT_USER_AGENT
_LOGGER = logging.getLogger(__name__)
@@ -20,21 +20,24 @@ def request_login(
:param url: Login url.
:login_data: Dictionary containing blink login data.
"""
headers = {"Host": DEFAULT_URL, "Content-Type": "application/json"}
headers = {
"Host": DEFAULT_URL,
"Content-Type": "application/json",
"Accept": "/",
"user-agent": DEFAULT_USER_AGENT,
}
data = dumps(
{
"email": login_data["username"],
"password": login_data["password"],
"notification_key": login_data["notification_key"],
"unique_id": login_data["uid"],
"app_version": "6.0.12",
"device_identifier": login_data["device_id"],
"client_name": "Computer",
"client_type": "android",
"os_version": "5.1.1",
"reauth": "true",
"reauth": "false",
}
)
return auth.query(
url=url,
headers=headers,
@@ -241,9 +244,7 @@ def request_camera_liveview(blink, network, camera_id):
:param network: Sync module network id.
:param camera_id: Camera ID of camera to request liveview from.
"""
url = (
f"{blink.urls.base_url}/api/v3/networks/{network}/cameras/{camera_id}/liveview"
)
url = f"{blink.urls.base_url}/api/v5/accounts/{blink.account_id}/networks/{network}/cameras/{camera_id}/liveview"
return http_post(blink, url)
+23 -7
View File
@@ -6,7 +6,12 @@ from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
from blinkpy import api
from blinkpy.helpers import util
from blinkpy.helpers.constants import BLINK_URL, LOGIN_ENDPOINT, TIMEOUT
from blinkpy.helpers.constants import (
BLINK_URL,
DEFAULT_USER_AGENT,
LOGIN_ENDPOINT,
TIMEOUT,
)
_LOGGER = logging.getLogger(__name__)
@@ -53,7 +58,11 @@ class Auth:
"""Return authorization header."""
if self.token is None:
return None
return {"TOKEN_AUTH": self.token}
return {
"TOKEN_AUTH": self.token,
"user-agent": DEFAULT_USER_AGENT,
"content-type": "application/json",
}
def create_session(self, opts=None):
"""Create a session for blink communication."""
@@ -108,11 +117,7 @@ class Auth:
try:
_LOGGER.info("Token expired, attempting automatic refresh.")
self.login_response = self.login()
self.region_id = self.login_response["region"]["tier"]
self.host = f"{self.region_id}.{BLINK_URL}"
self.token = self.login_response["authtoken"]["authtoken"]
self.client_id = self.login_response["client"]["id"]
self.account_id = self.login_response["account"]["id"]
self.extract_login_info()
self.is_errored = False
except LoginError:
_LOGGER.error("Login endpoint failed. Try again later.")
@@ -122,6 +127,14 @@ class Auth:
raise TokenRefreshFailed
return True
def extract_login_info(self):
"""Extract login info from login response."""
self.region_id = self.login_response["region"]["tier"]
self.host = f"{self.region_id}.{BLINK_URL}"
self.token = self.login_response["authtoken"]["authtoken"]
self.client_id = self.login_response["client"]["id"]
self.account_id = self.login_response["account"]["id"]
def startup(self):
"""Initialize tokens for communication."""
self.validate_login()
@@ -218,6 +231,9 @@ class Auth:
try:
json_resp = response.json()
blink.available = json_resp["valid"]
if not json_resp["valid"]:
_LOGGER.error(f"{json_resp['message']}")
return False
except (KeyError, TypeError):
_LOGGER.error("Did not receive valid response from server.")
return False
+7 -5
View File
@@ -76,20 +76,22 @@ class Blink:
self.no_owls = no_owls
@util.Throttle(seconds=MIN_THROTTLE_TIME)
def refresh(self, force=False):
def refresh(self, force=False, force_cache=False):
"""
Perform a system refresh.
:param force: Force an update of the camera data
:param force: Used to override throttle, resets refresh
:param force_cache: Used to force update without overriding throttle
"""
if self.check_if_ok_to_update() or force:
if self.check_if_ok_to_update() or force or force_cache:
if not self.available:
self.setup_post_verify()
self.get_homescreen()
for sync_name, sync_module in self.sync.items():
_LOGGER.debug("Attempting refresh of sync %s", sync_name)
sync_module.refresh(force_cache=force)
if not force:
sync_module.refresh(force_cache=(force or force_cache))
if not force_cache:
# Prevents rapid clearing of motion detect property
self.last_refresh = int(time.time())
return True
+15 -17
View File
@@ -98,6 +98,15 @@ class BlinkCamera:
self.sync.blink, self.network_id, self.camera_id
)
def get_media(self, media_type="image"):
"""Download media (image or video)."""
url = self.thumbnail
if media_type.lower() == "video":
url = self.clip
return api.http_get(
self.sync.blink, url=url, stream=True, json=False, timeout=TIMEOUT_MEDIA,
)
def snap_picture(self):
"""Take a picture with camera to create a new thumbnail."""
return api.request_new_image(self.sync.blink, self.network_id, self.camera_id)
@@ -180,21 +189,10 @@ class BlinkCamera:
update_cached_video = True
if new_thumbnail is not None and (update_cached_image or force_cache):
self._cached_image = api.http_get(
self.sync.blink,
url=self.thumbnail,
stream=True,
json=False,
timeout=TIMEOUT_MEDIA,
)
self._cached_image = self.get_media()
if clip_addr is not None and (update_cached_video or force_cache):
self._cached_video = api.http_get(
self.sync.blink,
url=self.clip,
stream=True,
json=False,
timeout=TIMEOUT_MEDIA,
)
self._cached_video = self.get_media(media_type="video")
def get_liveview(self):
"""Get livewview rtsps link."""
@@ -210,7 +208,7 @@ class BlinkCamera:
:param path: Path to write file
"""
_LOGGER.debug("Writing image from %s to %s", self.name, path)
response = self._cached_image
response = self.get_media()
if response.status_code == 200:
with open(path, "wb") as imgfile:
copyfileobj(response.raw, imgfile)
@@ -226,7 +224,7 @@ class BlinkCamera:
:param path: Path to write file
"""
_LOGGER.debug("Writing video from %s to %s", self.name, path)
response = self._cached_video
response = self.get_media(media_type="video")
if response is None:
_LOGGER.error("No saved video exist for %s.", self.name)
return
@@ -268,6 +266,6 @@ class BlinkCameraMini(BlinkCamera):
response = api.http_post(self.sync.blink, url)
server = response["server"]
server_split = server.split(":")
server_split[0] = "rtsps"
server_split[0] = "rtsps:"
link = "".join(server_split)
return link
+3 -1
View File
@@ -4,7 +4,7 @@ import os
MAJOR_VERSION = 0
MINOR_VERSION = 16
PATCH_VERSION = "2-rc0"
PATCH_VERSION = "5.rc0"
__version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}"
@@ -34,6 +34,7 @@ PROJECT_CLASSIFIERS = [
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Home Automation",
]
@@ -58,6 +59,7 @@ ONLINE = {"online": True, "offline": False}
"""
OTHER
"""
DEFAULT_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
DEVICE_ID = "Blinkpy"
TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
DEFAULT_MOTION_INTERVAL = 1
+2 -2
View File
@@ -145,7 +145,7 @@ class BlinkSyncModule:
for owl in self.blink.homescreen["owls"]:
if owl["name"] == name:
return owl
except KeyError:
except (TypeError, KeyError):
pass
return None
@@ -270,7 +270,7 @@ class BlinkOwl(BlinkSyncModule):
if owl["name"] == self.name:
self.status = owl["enabled"]
return owl
except KeyError:
except (TypeError, KeyError):
pass
return None
-1
View File
@@ -1,4 +1,3 @@
python-dateutil>=2.8.1
requests>=2.24.0
python-slugify>=4.0.1
testtools>=2.4.0
+10 -9
View File
@@ -1,13 +1,14 @@
black==19.10b0
coverage==5.2.1
flake8==3.8.3
coverage==5.4
flake8==3.8.4
flake8-docstrings==1.5.0
pre-commit==2.6.0
pylint==2.5.3
pydocstyle==5.0.2
pytest==6.0.1
pytest-cov==2.10.0
pre-commit==2.9.3
pylint==2.6.0
pydocstyle==5.1.1
pytest==6.2.2
pytest-cov==2.11.1
pytest-sugar==0.9.4
pytest-timeout==1.4.2
restructuredtext-lint==1.3.1
pygments==2.6.1
restructuredtext-lint==1.3.2
pygments==2.7.4
testtools>=2.4.0
+5 -1
View File
@@ -128,7 +128,11 @@ class TestAuth(unittest.TestCase):
def test_header(self):
"""Test header data."""
self.auth.token = "bar"
expected_header = {"TOKEN_AUTH": "bar"}
expected_header = {
"TOKEN_AUTH": "bar",
"user-agent": const.DEFAULT_USER_AGENT,
"content-type": "application/json",
}
self.assertDictEqual(self.auth.header, expected_header)
def test_header_no_token(self):
+23 -16
View File
@@ -5,29 +5,23 @@ import logging
from blinkpy import blinkpy
from blinkpy.sync_module import BlinkSyncModule
from blinkpy.camera import BlinkCamera
from blinkpy.helpers.util import get_time, BlinkURLHandler
class MockSyncModule(BlinkSyncModule):
"""Mock http requests from sync module."""
"""Mock blink sync module object."""
def __init__(self, blink, header):
"""Create mock sync module instance."""
super().__init__(blink, header, network_id=None, camera_list=None)
self.blink = blink
self.header = header
self.return_value = None
self.return_value2 = None
def get_network_info(self):
"""Mock network info method."""
return True
def http_get(self, url, stream=False, json=True):
"""Mock get request."""
if stream and self.return_value2 is not None:
return self.return_value2
return self.return_value
def http_post(self, url):
"""Mock post request."""
return self.return_value
class MockCamera(BlinkCamera):
"""Mock blink camera object."""
def update(self, config, force_cache=False, **kwargs):
"""Mock camera update method."""
class TestBlinkFunctions(unittest.TestCase):
@@ -121,3 +115,16 @@ class TestBlinkFunctions(unittest.TestCase):
with self.assertLogs() as dl_log:
blink.download_videos("/tmp", camera="bar", stop=2)
self.assertEqual(dl_log.output, expected_log)
@mock.patch("blinkpy.blinkpy.api.request_network_update")
@mock.patch("blinkpy.auth.Auth.query")
def test_refresh(self, mock_req, mock_update):
"""Test ability to refresh system."""
mock_update.return_value = {"network": {"sync_module_error": False}}
mock_req.return_value = None
self.blink.last_refresh = 0
self.blink.available = True
self.blink.sync["foo"] = MockSyncModule(self.blink, "foo", 1, [])
self.blink.cameras = {"bar": MockCamera(self.blink.sync)}
self.blink.sync["foo"].cameras = self.blink.cameras
self.assertTrue(self.blink.refresh())
+2 -2
View File
@@ -68,8 +68,8 @@ class TestBlinkSetup(unittest.TestCase):
self.assertEqual(self.blink.last_refresh, None)
with mock.patch(
"blinkpy.sync_module.BlinkSyncModule.refresh", return_value=True
):
self.blink.refresh()
), mock.patch("blinkpy.blinkpy.Blink.get_homescreen", return_value=True):
self.blink.refresh(force=True)
self.assertEqual(self.blink.last_refresh, now)
self.assertEqual(self.blink.check_if_ok_to_update(), False)
+7
View File
@@ -176,3 +176,10 @@ class TestBlinkCameraSetup(unittest.TestCase):
attr = camera.attributes
for key in attr:
self.assertEqual(attr[key], None)
def test_camera_stream(self, mock_resp):
"""Test that camera stream returns correct url."""
mock_resp.return_value = {"server": "rtsps://foo.bar"}
mini_camera = BlinkCameraMini(self.blink.sync["test"])
self.assertEqual(self.camera.get_liveview(), "rtsps://foo.bar")
self.assertEqual(mini_camera.get_liveview(), "rtsps://foo.bar")