From 7f782533b8db208a42c3b64aa5f4c2e3601dd6ad Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Sun, 2 Aug 2020 03:09:22 +0000 Subject: [PATCH 1/3] Dev version bump --- blinkpy/helpers/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blinkpy/helpers/constants.py b/blinkpy/helpers/constants.py index 9702acbf..596fd0cb 100644 --- a/blinkpy/helpers/constants.py +++ b/blinkpy/helpers/constants.py @@ -3,8 +3,8 @@ import os MAJOR_VERSION = 0 -MINOR_VERSION = 16 -PATCH_VERSION = 2 +MINOR_VERSION = 17 +PATCH_VERSION = "0.dev0" __version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}" From cb43f17d75c4de0351740e90e08ffef9dfcc13d1 Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Sun, 2 Aug 2020 03:22:49 +0000 Subject: [PATCH 2/3] Add user agent to all headers --- blinkpy/auth.py | 9 +++++++-- tests/test_auth.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/blinkpy/auth.py b/blinkpy/auth.py index b3d6fe07..bc613879 100644 --- a/blinkpy/auth.py +++ b/blinkpy/auth.py @@ -6,7 +6,12 @@ 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,7 @@ def header(self): """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} def create_session(self, opts=None): """Create a session for blink communication.""" diff --git a/tests/test_auth.py b/tests/test_auth.py index 1c85a6d7..c5c082b6 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -128,7 +128,7 @@ def test_response_bad_json(self): 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} self.assertDictEqual(self.auth.header, expected_header) def test_header_no_token(self): From 6dbed9142656d8ed4f1e56d4f6252fee230e4b4d Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Sun, 2 Aug 2020 03:24:38 +0000 Subject: [PATCH 3/3] Update changelog for 0.16.3 --- CHANGES.rst | 5 +++++ blinkpy/helpers/constants.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 224ff61e..9646499b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,11 @@ 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) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/blinkpy/helpers/constants.py b/blinkpy/helpers/constants.py index 596fd0cb..bf43b5c2 100644 --- a/blinkpy/helpers/constants.py +++ b/blinkpy/helpers/constants.py @@ -3,8 +3,8 @@ import os MAJOR_VERSION = 0 -MINOR_VERSION = 17 -PATCH_VERSION = "0.dev0" +MINOR_VERSION = 16 +PATCH_VERSION = 3 __version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}"