diff --git a/blinkpy/auth.py b/blinkpy/auth.py index bb559907..38cb86f4 100644 --- a/blinkpy/auth.py +++ b/blinkpy/auth.py @@ -10,6 +10,7 @@ from blinkpy.helpers import util from blinkpy.helpers.constants import ( BLINK_URL, + APP_BUILD, DEFAULT_USER_AGENT, LOGIN_ENDPOINT, TIMEOUT, @@ -64,9 +65,10 @@ def header(self): if self.token is None: return None return { + "APP-BUILD": APP_BUILD, "TOKEN_AUTH": self.token, - "user-agent": DEFAULT_USER_AGENT, - "content-type": "application/json", + "User-Agent": DEFAULT_USER_AGENT, + "Content-Type": "application/json", } def validate_login(self): diff --git a/blinkpy/helpers/constants.py b/blinkpy/helpers/constants.py index 6af0671a..6ffc530b 100644 --- a/blinkpy/helpers/constants.py +++ b/blinkpy/helpers/constants.py @@ -20,7 +20,7 @@ """ OTHER """ - +APP_BUILD = "ANDROID_28373244" DEFAULT_USER_AGENT = "27.0ANDROID_28373244" DEVICE_ID = "Blinkpy" TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%S%z" diff --git a/tests/test_auth.py b/tests/test_auth.py index 31a9bda5..0d6168e9 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -132,9 +132,10 @@ def test_header(self): """Test header data.""" self.auth.token = "bar" expected_header = { + "APP-BUILD": const.APP_BUILD, "TOKEN_AUTH": "bar", - "user-agent": const.DEFAULT_USER_AGENT, - "content-type": "application/json", + "User-Agent": const.DEFAULT_USER_AGENT, + "Content-Type": "application/json", } self.assertDictEqual(self.auth.header, expected_header)