Skip to content

Commit 19b7eef

Browse files
authored
Merge pull request #363 from fronzbot/dev
0.16.3
2 parents 6bd8d14 + 41d59b1 commit 19b7eef

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Changelog
44

55
A list of changes between each release
66

7+
0.16.3 (2020-08-02)
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
10+
- Add user-agent to all headers
11+
712
0.16.2 (2020-08-01)
813
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
914

blinkpy/auth.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
from urllib3.util.retry import Retry
77
from blinkpy import api
88
from blinkpy.helpers import util
9-
from blinkpy.helpers.constants import BLINK_URL, LOGIN_ENDPOINT, TIMEOUT
9+
from blinkpy.helpers.constants import (
10+
BLINK_URL,
11+
DEFAULT_USER_AGENT,
12+
LOGIN_ENDPOINT,
13+
TIMEOUT,
14+
)
1015

1116
_LOGGER = logging.getLogger(__name__)
1217

@@ -53,7 +58,7 @@ def header(self):
5358
"""Return authorization header."""
5459
if self.token is None:
5560
return None
56-
return {"TOKEN_AUTH": self.token}
61+
return {"TOKEN_AUTH": self.token, "user-agent": DEFAULT_USER_AGENT}
5762

5863
def create_session(self, opts=None):
5964
"""Create a session for blink communication."""

blinkpy/helpers/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
MAJOR_VERSION = 0
66
MINOR_VERSION = 16
7-
PATCH_VERSION = 2
7+
PATCH_VERSION = 3
88

99
__version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}"
1010

tests/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_response_bad_json(self):
128128
def test_header(self):
129129
"""Test header data."""
130130
self.auth.token = "bar"
131-
expected_header = {"TOKEN_AUTH": "bar"}
131+
expected_header = {"TOKEN_AUTH": "bar", "user-agent": const.DEFAULT_USER_AGENT}
132132
self.assertDictEqual(self.auth.header, expected_header)
133133

134134
def test_header_no_token(self):

0 commit comments

Comments
 (0)