Compare commits

...
106 Commits
Author SHA1 Message Date
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
Kevin FronczakandGitHub 11d6bbb916 Merge pull request #354 from fronzbot/dev-rc-bump
Dev rc bump
2020-07-31 22:15:13 -04:00
Kevin FronczakandGitHub b02f6318a7 Merge pull request #353 from fronzbot/update-app-version
Update app version and set reauth to True...should fix login problems
2020-07-31 22:15:02 -04:00
Kevin FronczakandGitHub c1435e74e8 Merge pull request #352 from fronzbot/dependabot/pip/pytest-6.0.1
Bump pytest from 6.0.0 to 6.0.1
2020-07-31 22:13:28 -04:00
Kevin Fronczak b30da661e5 Dev rc bump 2020-08-01 02:12:42 +00:00
Kevin Fronczak 3a22dddc82 Update app version and set reauth to True...should fix login problems 2020-08-01 02:10:25 +00:00
dependabot-preview[bot]andGitHub a19a17d4dc Bump pytest from 6.0.0 to 6.0.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.0 to 6.0.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.0...6.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-31 08:16:15 +00:00
Kevin FronczakandGitHub bff6ef92ce Merge pull request #350 from fronzbot/dev-version-bump
Dev bump
2020-07-29 11:38:18 -04:00
Kevin Fronczak 263572eb66 Dev bump 2020-07-29 15:28:13 +00:00
Kevin FronczakandGitHub 3a97a928de Merge pull request #348 from fronzbot/0.16.1-changelog
Updated versions and changelog for 0.16.1
2020-07-29 11:27:26 -04:00
Kevin Fronczak 0322414de1 Updated versions and changelog for 0.16.1 2020-07-29 15:23:59 +00:00
Kevin FronczakandGitHub 1c75e86863 Merge pull request #347 from fronzbot/unpin-reqs
Set min version for reqs instead of pinning
2020-07-29 11:23:11 -04:00
Kevin FronczakandGitHub 0ae71f6367 Merge pull request #345 from fronzbot/dependabot/pip/pytest-6.0.0
Bump pytest from 5.4.3 to 6.0.0
2020-07-29 11:19:38 -04:00
Kevin FronczakandGitHub af7c38695a Merge pull request #344 from fronzbot/dependabot/pip/coverage-5.2.1
Bump coverage from 5.2 to 5.2.1
2020-07-29 11:19:21 -04:00
Kevin Fronczak c741c22876 Set min version for reqs instead of pinning 2020-07-29 15:15:19 +00:00
dependabot-preview[bot]andGitHub 06b9b12eeb Bump pytest from 5.4.3 to 6.0.0
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.3 to 6.0.0.
- [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/5.4.3...6.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-29 08:05:56 +00:00
dependabot-preview[bot]andGitHub daf7078f98 Bump coverage from 5.2 to 5.2.1
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.2 to 5.2.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.2...coverage-5.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 08:17:40 +00:00
Kevin FronczakandGitHub c2db57ecb3 Merge pull request #341 from fronzbot/dev-bump
Dev version bump
2020-07-20 23:01:51 -04:00
Kevin Fronczak 0336c6a8f8 Dev version bump 2020-07-20 02:24:28 +00:00
Kevin Fronczak 22d3fa9565 Merge remote-tracking branch 'origin/master' into dev 2020-07-20 02:19:27 +00:00
Kevin FronczakandGitHub 9d81973b3a Merge pull request #339 from fronzbot/retry-options
Retry options
2020-07-19 21:47:40 -04:00
Kevin Fronczak fe8eac3dc6 Update documentation 2020-07-20 01:42:07 +00:00
Kevin Fronczak 5fc315201a Add tests for retry options 2020-07-20 01:33:11 +00:00
Kevin Fronczak a9d3d5568b Adding retry options to auth class 2020-07-20 01:25:09 +00:00
Kevin FronczakandGitHub f88dbdaeba Merge pull request #338 from fronzbot/fix-auth-tests
Fix broken test and missing try/except
2020-07-19 21:24:50 -04:00
Kevin Fronczak 48028914de Fix broken test and missing try/except 2020-07-20 01:18:41 +00:00
Kevin FronczakandGitHub fcdb70d246 Merge pull request #337 from fronzbot/remove-exec-info
Removed all exc_info parameters during logging
2020-07-19 20:51:38 -04:00
Kevin Fronczak e8589bfa05 Fix test 2020-07-20 00:48:40 +00:00
Kevin Fronczak 854ffbf26a Removed all exc_info parameters during logging 2020-07-20 00:37:30 +00:00
Kevin FronczakandGitHub ca109f703c Merge pull request #336 from fronzbot/dev-bump
Dev version bump
2020-07-19 20:37:22 -04:00
Kevin Fronczak 82d5a7ea51 Dev version bump 2020-07-20 00:34:06 +00:00
Kevin FronczakandGitHub 79ead7b826 Merge pull request #333 from fronzbot/dependabot/pip/pytest-timeout-1.4.2
Bump pytest-timeout from 1.4.1 to 1.4.2
2020-07-16 13:03:03 -04:00
dependabot-preview[bot]andGitHub 6e360b2bb1 Bump pytest-timeout from 1.4.1 to 1.4.2
Bumps [pytest-timeout](https://github.com/pytest-dev/pytest-timeout) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/pytest-dev/pytest-timeout/releases)
- [Commits](https://github.com/pytest-dev/pytest-timeout/compare/1.4.1...1.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-16 08:06:30 +00:00
Kevin FronczakandGitHub 1aaa5b649f Merge pull request #331 from fronzbot/remove-host
Remove host from auth header
2020-07-11 11:24:47 -04:00
Kevin FronczakandGitHub 435f3b9831 Update CHANGES.rst 2020-07-11 10:44:37 -04:00
Kevin FronczakandGitHub bcf0bb5525 Merge pull request #330 from fronzbot/bugfix
Bugfix: remove Host from auth header
2020-07-11 10:42:44 -04:00
Kevin Fronczak 322aae37dc fix test (remove host) 2020-07-11 14:41:44 +00:00
Kevin Fronczak 45cb4028b8 Remove host from auth header 2020-07-11 14:39:45 +00:00
Kevin Fronczak 151d9b7375 Version bump 2020-07-11 14:37:04 +00:00
Kevin Fronczak d393c861d7 bugfix: remove host from auth header 2020-07-11 14:36:37 +00:00
Kevin Fronczak 02c4b2e7e1 Add rst linter to pre-commit and fix flake8 2020-07-11 14:36:06 +00:00
Kevin FronczakandGitHub 77959d6d94 Merge pull request #327 from fronzbot/dependabot/pip/pytest-sugar-0.9.4
Bump pytest-sugar from 0.9.3 to 0.9.4
2020-07-08 22:47:46 -04:00
Kevin FronczakandGitHub ad832c4d2d Merge pull request #326 from fronzbot/dependabot/pip/coverage-5.2
Bump coverage from 5.1 to 5.2
2020-07-08 22:46:54 -04:00
Kevin FronczakandGitHub 0ce2aec139 Merge pull request #328 from fronzbot/remove-unbound-ref
Remove reference to response on exception since it may be unbound
2020-07-08 22:46:29 -04:00
Kevin Fronczak d3761b23ec Remove reference to response on exception since it may be unbound 2020-07-08 17:57:56 +00:00
dependabot-preview[bot]andGitHub cdbd1a4c27 Bump pytest-sugar from 0.9.3 to 0.9.4
Bumps [pytest-sugar](https://github.com/Teemu/pytest-sugar) from 0.9.3 to 0.9.4.
- [Release notes](https://github.com/Teemu/pytest-sugar/releases)
- [Changelog](https://github.com/Teemu/pytest-sugar/blob/master/CHANGES.rst)
- [Commits](https://github.com/Teemu/pytest-sugar/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-07 08:16:07 +00:00
dependabot-preview[bot]andGitHub 2d2e569595 Bump coverage from 5.1 to 5.2
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.1 to 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/coverage-5.1...coverage-5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-07 08:15:43 +00:00
Kevin FronczakandGitHub 391373b304 Merge pull request #324 from fronzbot/http-adapter
Modify session to use HTTPAdapter and handle retries
2020-07-02 14:34:45 -04:00
Kevin Fronczak a030f46b4d Modify session to use HTTPAdapter and handle retries 2020-07-02 18:15:29 +00:00
Kevin FronczakandGitHub f6dc22f241 Merge pull request #323 from fronzbot/image-and-video-timeout
Add different timeout for video and image retrieval
2020-07-02 11:40:31 -04:00
Kevin Fronczak 220638e525 Add different timeout for video and image retrieval 2020-07-02 14:50:38 +00:00
Kevin FronczakandGitHub 24b1aac1be Merge pull request #322 from fronzbot/dependabot/pip/pre-commit-2.6.0
Bump pre-commit from 2.5.1 to 2.6.0
2020-07-02 08:46:50 -04:00
dependabot-preview[bot]andGitHub c4608f4258 Bump pre-commit from 2.5.1 to 2.6.0
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.5.1 to 2.6.0.
- [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.5.1...v2.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-02 08:15:35 +00:00
Kevin FronczakandGitHub ca19ea62a4 Merge pull request #321 from fronzbot/dependabot/pip/python-slugify-approx-eq-4.0.1
Update python-slugify requirement from ~=4.0.0 to ~=4.0.1
2020-06-30 12:47:24 -04:00
Kevin FronczakandGitHub 2d8f4d8289 Merge pull request #320 from fronzbot/roll-back
Rolled back to rc8, removed v3 auth functionality (poorly thought out)
2020-06-30 12:46:57 -04:00
Kevin Fronczak 24ca9d9617 Fixed request version, improved setup.py requirement import 2020-06-30 16:40:19 +00:00
dependabot-preview[bot]andGitHub 41aa1839b7 Update python-slugify requirement from ~=4.0.0 to ~=4.0.1
Updates the requirements on [python-slugify](https://github.com/un33k/python-slugify) to permit the latest version.
- [Release notes](https://github.com/un33k/python-slugify/releases)
- [Changelog](https://github.com/un33k/python-slugify/blob/master/CHANGELOG.md)
- [Commits](https://github.com/un33k/python-slugify/compare/4.0.0...4.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-30 07:53:51 +00:00
Kevin Fronczak 40354e87a0 Rolled back to rc8, removed v3 auth functionality (poorly thought out) 2020-06-29 17:23:15 +00:00
Kevin FronczakandGitHub 0fc74c3f82 Merge pull request #319 from fronzbot/login-fix
Changed the way the new login method switch is handled
2020-06-29 13:06:01 -04:00
Kevin Fronczak 7b150eb1af Changed the way the new login method switch is handled 2020-06-29 17:01:46 +00:00
Kevin FronczakandGitHub f8db8eb3b6 Merge pull request #318 from fronzbot/login-switch
Add option to use v3 login endpoint
2020-06-29 12:49:56 -04:00
Kevin FronczakandGitHub a34b6dec67 Merge pull request #315 from fronzbot/dependabot/pip/requests-approx-eq-2.24.0
Update requests requirement from ~=2.23.0 to ~=2.24.0
2020-06-29 11:54:10 -04:00
Kevin Fronczak bded3eb156 Add option to use v3 login endpoint 2020-06-29 15:46:43 +00:00
dependabot-preview[bot]andGitHub 9ca73934ce Update requests requirement from ~=2.23.0 to ~=2.24.0
Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.23.0...v2.24.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-18 08:04:10 +00:00
Kevin FronczakandGitHub e02b429523 Merge pull request #314 from fronzbot/fix-return-error
Fix error with updating owl information during refresh
2020-06-16 14:46:40 -04:00
Kevin Fronczak 22e4b7dabe Fix error with updating owl information during refresh 2020-06-16 18:42:59 +00:00
18 changed files with 253 additions and 88 deletions
+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
+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
+50
View File
@@ -4,6 +4,56 @@ Changelog
A list of changes between each release
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 requirements, set minimum version instead
- Bump coverage to 5.2.1
- Bump pytest to 6.0.0
0.16.0 (2020-07-20)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**Breaking Changes:**
- Add arm property to camera, deprecate motion enable method (`#273 <https://github.com/fronzbot/blinkpy/pull/273>`__)
- Complete refactoring of auth logic (breaks all pre-0.16.0 setups!) (`#261 <https://github.com/fronzbot/blinkpy/pull/261>`__)
**New Features:**
- Add is_errored property to Auth class (`#275 <https://github.com/fronzbot/blinkpy/pull/275>`__)
- Add new endpoint to get user infor (`#280 <https://github.com/fronzbot/blinkpy/pull/280>`__)
- Add get_liveview command to camera module (`#289 <https://github.com/fronzbot/blinkpy/pull/289>`__)
- Add blink Mini Camera support (`#290 <https://github.com/fronzbot/blinkpy/pull/290>`__)
- Add option to skip homescreen check (`#305 <https://github.com/fronzbot/blinkpy/pull/305>`__)
- Add different timeout for video and image retrieval (`#323 <https://github.com/fronzbot/blinkpy/pull/323>`__)
- Modifiy session to use HTTPAdapter and handle retries (`#324 <https://github.com/fronzbot/blinkpy/pull/324>`__)
- Add retry option overrides (`#339 <https://github.com/fronzbot/blinkpy/pull/339>`__)
**All changes:**
Please see the change list in the (`Release Notes <https://github.com/fronzbot/releases/tag/v0.16.0>`__)
0.15.1 (2020-07-11)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Bugfix: remove "Host" from auth header (`#330 <https://github.com/fronzbot/blinkpy/pull/330>`__)
0.15.0 (2020-05-08)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**Breaking Changes:**
+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:
+11 -10
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
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.7 (520300) #afb0be72a",
"device_identifier": login_data["device_id"],
"client_name": "Computer",
"client_type": "android",
"os_version": "5.1.1",
"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)
@@ -284,7 +285,7 @@ def request_motion_detection_disable(blink, network, camera_id):
return http_post(blink, url)
def http_get(blink, url, stream=False, json=True, is_retry=False):
def http_get(blink, url, stream=False, json=True, is_retry=False, timeout=TIMEOUT):
"""
Perform an http get request.
@@ -304,7 +305,7 @@ def http_get(blink, url, stream=False, json=True, is_retry=False):
)
def http_post(blink, url, is_retry=False):
def http_post(blink, url, is_retry=False, timeout=TIMEOUT):
"""
Perform an http post request.
+48 -16
View File
@@ -2,9 +2,16 @@
import logging
from functools import partial
from requests import Request, Session, exceptions
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
from blinkpy.helpers.constants import (
BLINK_URL,
DEFAULT_USER_AGENT,
LOGIN_ENDPOINT,
TIMEOUT,
)
_LOGGER = logging.getLogger(__name__)
@@ -51,12 +58,27 @@ class Auth:
"""Return authorization header."""
if self.token is None:
return None
return {"Host": self.host, "TOKEN_AUTH": self.token}
return {"TOKEN_AUTH": self.token, "user-agent": DEFAULT_USER_AGENT}
def create_session(self):
def create_session(self, opts=None):
"""Create a session for blink communication."""
if opts is None:
opts = {}
backoff = opts.get("backoff", 1)
retries = opts.get("retries", 3)
retry_list = opts.get("retry_list", [429, 500, 502, 503, 504])
sess = Session()
sess.get = partial(sess.get, timeout=10)
assert_status_hook = [
lambda response, *args, **kwargs: response.raise_for_status()
]
sess.hooks["response"] = assert_status_hook
retry = Retry(
total=retries, backoff_factor=backoff, status_forcelist=retry_list
)
adapter = HTTPAdapter(max_retries=retry)
sess.mount("https://", adapter)
sess.mount("http://", adapter)
sess.get = partial(sess.get, timeout=TIMEOUT)
return sess
def prepare_request(self, url, headers, data, reqtype):
@@ -91,11 +113,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.")
@@ -105,6 +123,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()
@@ -140,6 +166,7 @@ class Auth:
stream=False,
json_resp=True,
is_retry=False,
timeout=TIMEOUT,
):
"""
Perform server requests.
@@ -154,21 +181,25 @@ class Auth:
"""
req = self.prepare_request(url, headers, data, reqtype)
try:
response = self.session.send(req, stream=stream)
response = self.session.send(req, stream=stream, timeout=timeout)
return self.validate_response(response, json_resp)
except (exceptions.ConnectionError, exceptions.Timeout):
_LOGGER.error(
"Connection error. Endpoint %s possibly down or throttled. %s: %s",
url,
response.status_code,
response.reason,
"Connection error. Endpoint %s possibly down or throttled.", url,
)
except BlinkBadResponse:
code = None
reason = None
try:
code = response.status_code
reason = response.reason
except AttributeError:
pass
_LOGGER.error(
"Expected json response from %s, but received: %s: %s",
url,
response.status_code,
response.reason,
code,
reason,
)
except UnauthorizedError:
try:
@@ -182,6 +213,7 @@ class Auth:
stream=stream,
json_resp=json_resp,
is_retry=True,
timeout=timeout,
)
_LOGGER.error("Unable to access %s after token refresh.", url)
except TokenRefreshFailed:
+9 -1
View File
@@ -29,6 +29,7 @@ from blinkpy.helpers.constants import (
DEFAULT_MOTION_INTERVAL,
DEFAULT_REFRESH,
MIN_THROTTLE_TIME,
TIMEOUT_MEDIA,
)
from blinkpy.helpers.constants import __version__
from blinkpy.auth import Auth, TokenRefreshFailed, LoginError
@@ -85,6 +86,7 @@ class Blink:
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)
@@ -330,7 +332,13 @@ class Blink:
_LOGGER.info("%s already exists, skipping...", filename)
continue
response = api.http_get(self, url=clip_address, stream=True, json=False)
response = api.http_get(
self,
url=clip_address,
stream=True,
json=False,
timeout=TIMEOUT_MEDIA,
)
with open(filename, "wb") as vidfile:
copyfileobj(response.raw, vidfile)
+16 -11
View File
@@ -3,6 +3,7 @@
from shutil import copyfileobj
import logging
from blinkpy import api
from blinkpy.helpers.constants import TIMEOUT_MEDIA
_LOGGER = logging.getLogger(__name__)
@@ -97,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)
@@ -150,9 +160,7 @@ class BlinkCamera:
if config.get("thumbnail", False):
thumb_addr = config["thumbnail"]
else:
_LOGGER.warning(
"Could not find thumbnail for camera %s", self.name, exc_info=True
)
_LOGGER.warning("Could not find thumbnail for camera %s", self.name)
if thumb_addr is not None:
new_thumbnail = f"{self.sync.urls.base_url}{thumb_addr}.jpg"
@@ -181,13 +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
)
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
)
self._cached_video = self.get_media(media_type="video")
def get_liveview(self):
"""Get livewview rtsps link."""
@@ -203,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)
@@ -219,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
+4 -1
View File
@@ -4,7 +4,7 @@ import os
MAJOR_VERSION = 0
MINOR_VERSION = 16
PATCH_VERSION = "0-rc7"
PATCH_VERSION = "4-rc0"
__version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}"
@@ -58,6 +58,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
@@ -65,3 +66,5 @@ DEFAULT_REFRESH = 30
MIN_THROTTLE_TIME = 2
SIZE_NOTIFICATION_KEY = 152
SIZE_UID = 16
TIMEOUT = 10
TIMEOUT_MEDIA = 90
+7 -7
View File
@@ -93,9 +93,7 @@ class BlinkSyncModule:
self.serial = self.summary["serial"]
self.status = self.summary["status"]
except KeyError:
_LOGGER.error(
"Could not extract some sync module info: %s", response, exc_info=True
)
_LOGGER.error("Could not extract some sync module info: %s", response)
is_ok = self.get_network_info()
self.check_new_videos()
@@ -158,7 +156,7 @@ class BlinkSyncModule:
try:
return response["event"]
except (TypeError, KeyError):
_LOGGER.error("Could not extract events: %s", response, exc_info=True)
_LOGGER.error("Could not extract events: %s", response)
return False
def get_camera_info(self, camera_id, **kwargs):
@@ -170,8 +168,8 @@ class BlinkSyncModule:
try:
return response["camera"][0]
except (TypeError, KeyError):
_LOGGER.error("Could not extract camera info: %s", response, exc_info=True)
return []
_LOGGER.error("Could not extract camera info: %s", response)
return {}
def get_network_info(self):
"""Retrieve network status."""
@@ -191,7 +189,9 @@ class BlinkSyncModule:
self.check_new_videos()
for camera_name in self.cameras.keys():
camera_id = self.cameras[camera_name].camera_id
camera_info = self.get_camera_info(camera_id)
camera_info = self.get_camera_info(
camera_id, owl_info=self.get_owl_info(camera_name)
)
self.cameras[camera_name].update(camera_info, force_cache=force_cache)
self.available = True
+23
View File
@@ -30,6 +30,29 @@ By default, the ``blink.auth.Auth`` class creates its own websession via its ``c
blink.auth = Auth()
blink.auth.session = YourCustomSession
Custom Retry Logic
--------------------
The built-in auth session via the ``create_session`` method allows for customizable retry intervals and conditions. These parameters are:
- retries
- backoff
- retry_list
``retries`` is the total number of retry attempts that each http request can do before timing out. ``backoff`` is a parameter that allows for non-linear retry times such that the time between retries is backoff*(2^(retries) - 1). ``retry_list`` is simply a list of status codes to force a retry. By default ``retries=3``, ``backoff=1``, and ``retry_list=[429, 500, 502, 503, 504]``. To override them, you need to add you overrides to a dictionary and use that to create a new session with the ``opts`` variable in the ``create_session`` method. The following example can serve as a guide where only the number of retries and backoff factor are overridden:
.. code:: python
from blinkpy.blinkpy import Blink
from blinkpy.auth import Auth
blink = Blink()
blink.auth = Auth()
opts = {"retries": 10, "backoff": 2}
blink.auth.session = blink.auth.create_session(opts=opts)
Custom HTTP requests
---------------------
In addition to custom sessions, custom blink server requests can be performed. This give you the ability to bypass the built-in ``Auth.query`` method. It also allows flexibility by giving you the option to pass your own url, rather than be limited to what is currently implemented in the ``blinkpy.api`` module.
+3 -4
View File
@@ -1,4 +1,3 @@
python-dateutil~=2.8.1
requests~=2.23.0
python-slugify~=4.0.0
testtools==2.4.0
python-dateutil>=2.8.1
requests>=2.24.0
python-slugify>=4.0.1
+11 -10
View File
@@ -1,13 +1,14 @@
black==19.10b0
coverage==5.1
flake8==3.8.3
coverage==5.3
flake8==3.8.4
flake8-docstrings==1.5.0
pre-commit==2.5.1
pylint==2.5.3
pydocstyle==5.0.2
pytest==5.4.3
pytest-cov==2.10.0
pytest-sugar==0.9.3
pytest-timeout==1.4.1
pre-commit==2.7.1
pylint==2.6.0
pydocstyle==5.1.1
pytest==6.1.1
pytest-cov==2.10.1
pytest-sugar==0.9.4
pytest-timeout==1.4.2
restructuredtext-lint==1.3.1
pygments==2.6.1
pygments==2.7.1
testtools>=2.4.0
+16 -13
View File
@@ -3,23 +3,26 @@
from os.path import abspath, dirname
from setuptools import setup, find_packages
from blinkpy.helpers.constants import (
__version__, PROJECT_PACKAGE_NAME, PROJECT_LICENSE, PROJECT_URL,
PROJECT_EMAIL, PROJECT_DESCRIPTION, PROJECT_CLASSIFIERS, PROJECT_AUTHOR,
__version__,
PROJECT_PACKAGE_NAME,
PROJECT_LICENSE,
PROJECT_URL,
PROJECT_EMAIL,
PROJECT_DESCRIPTION,
PROJECT_CLASSIFIERS,
PROJECT_AUTHOR,
)
PROJECT_VERSION = __version__
THIS_DIR = abspath(dirname(__file__))
REQUIRES = [
"python-dateutil~=2.8.1",
"requests~=2.23.0",
"python-slugify~=4.0.0",
]
with open(f"{THIS_DIR}/requirements.txt") as req_file:
REQUIRES = [line.rstrip() for line in req_file]
PACKAGES = find_packages(exclude=['tests*', 'docs'])
PACKAGES = find_packages(exclude=["tests*", "docs"])
with open('{}/README.rst'.format(THIS_DIR), encoding='utf-8') as readme_file:
with open("{}/README.rst".format(THIS_DIR), encoding="utf-8") as readme_file:
LONG_DESCRIPTION = readme_file.read()
setup(
@@ -31,11 +34,11 @@ setup(
author_email=PROJECT_EMAIL,
license=PROJECT_LICENSE,
url=PROJECT_URL,
platforms='any',
py_modules=['blinkpy'],
platforms="any",
py_modules=["blinkpy"],
packages=PACKAGES,
include_package_data=True,
install_requires=REQUIRES,
test_suite='tests',
classifiers=PROJECT_CLASSIFIERS
test_suite="tests",
classifiers=PROJECT_CLASSIFIERS,
)
+45 -3
View File
@@ -128,8 +128,7 @@ class TestAuth(unittest.TestCase):
def test_header(self):
"""Test header data."""
self.auth.token = "bar"
self.auth.host = "foo"
expected_header = {"Host": "foo", "TOKEN_AUTH": "bar"}
expected_header = {"TOKEN_AUTH": "bar", "user-agent": const.DEFAULT_USER_AGENT}
self.assertDictEqual(self.auth.header, expected_header)
def test_header_no_token(self):
@@ -231,7 +230,7 @@ class TestAuth(unittest.TestCase):
@mock.patch("blinkpy.auth.Auth.refresh_token")
def test_query_retry_failed(self, mock_refresh, mock_validate):
"""Check handling of failed retry request."""
self.auth.seession = MockSession()
self.auth.session = MockSession()
mock_validate.side_effect = [UnauthorizedError, BlinkBadResponse]
mock_refresh.return_value = True
self.assertEqual(self.auth.query(url="http://example.com"), None)
@@ -239,6 +238,49 @@ class TestAuth(unittest.TestCase):
mock_validate.side_effect = [UnauthorizedError, TokenRefreshFailed]
self.assertEqual(self.auth.query(url="http://example.com"), None)
def test_default_session(self):
"""Test default session creation."""
sess = self.auth.create_session()
adapter = sess.adapters["https://"]
self.assertEqual(adapter.max_retries.total, 3)
self.assertEqual(adapter.max_retries.backoff_factor, 1)
self.assertEqual(
adapter.max_retries.status_forcelist, [429, 500, 502, 503, 504]
)
def test_custom_session_full(self):
"""Test full custom session creation."""
opts = {"backoff": 2, "retries": 10, "retry_list": [404]}
sess = self.auth.create_session(opts=opts)
adapter = sess.adapters["https://"]
self.assertEqual(adapter.max_retries.total, 10)
self.assertEqual(adapter.max_retries.backoff_factor, 2)
self.assertEqual(adapter.max_retries.status_forcelist, [404])
def test_custom_session_partial(self):
"""Test partial custom session creation."""
opts1 = {"backoff": 2}
opts2 = {"retries": 5}
opts3 = {"retry_list": [101, 202]}
sess1 = self.auth.create_session(opts=opts1)
sess2 = self.auth.create_session(opts=opts2)
sess3 = self.auth.create_session(opts=opts3)
adapt1 = sess1.adapters["https://"]
adapt2 = sess2.adapters["https://"]
adapt3 = sess3.adapters["https://"]
self.assertEqual(adapt1.max_retries.total, 3)
self.assertEqual(adapt1.max_retries.backoff_factor, 2)
self.assertEqual(adapt1.max_retries.status_forcelist, [429, 500, 502, 503, 504])
self.assertEqual(adapt2.max_retries.total, 5)
self.assertEqual(adapt2.max_retries.backoff_factor, 1)
self.assertEqual(adapt2.max_retries.status_forcelist, [429, 500, 502, 503, 504])
self.assertEqual(adapt3.max_retries.total, 3)
self.assertEqual(adapt3.max_retries.backoff_factor, 1)
self.assertEqual(adapt3.max_retries.status_forcelist, [101, 202])
class MockSession:
"""Object to mock a session."""
+1 -1
View File
@@ -68,7 +68,7 @@ class TestBlinkSetup(unittest.TestCase):
self.assertEqual(self.blink.last_refresh, None)
with mock.patch(
"blinkpy.sync_module.BlinkSyncModule.refresh", return_value=True
):
), mock.patch("blinkpy.blinkpy.Blink.get_homescreen", return_value=True):
self.blink.refresh()
self.assertEqual(self.blink.last_refresh, now)
+1 -4
View File
@@ -117,10 +117,7 @@ class TestBlinkCameraSetup(unittest.TestCase):
"WARNING:blinkpy.camera:Could not retrieve calibrated "
"temperature."
),
(
"WARNING:blinkpy.camera:Could not find thumbnail for camera new"
"\nNoneType: None"
),
("WARNING:blinkpy.camera:Could not find thumbnail for camera new"),
],
)
+3 -3
View File
@@ -80,11 +80,11 @@ class TestBlinkSyncModule(unittest.TestCase):
def test_get_camera_info_fail(self, mock_resp):
"""Test handling of failed get camera info function."""
mock_resp.return_value = None
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), [])
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), {})
mock_resp.return_value = {}
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), [])
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), {})
mock_resp.return_value = {"camera": None}
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), [])
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), {})
def test_get_network_info(self, mock_resp):
"""Test network retrieval."""