Merge pull request #9 from fronzbot/patch
Fixed issue with host name in header, added test to catch this
This commit is contained in:
@@ -9,3 +9,4 @@ dist/*
|
||||
MANIFEST
|
||||
README
|
||||
.sh
|
||||
build/*
|
||||
|
||||
+1
-1
@@ -376,7 +376,7 @@ class Blink(object):
|
||||
response = _request(LOGIN_URL, headers=headers, data=data, type='post')
|
||||
self._TOKEN = response['authtoken']['authtoken']
|
||||
(self._REGION_ID, self._REGION), = response['region'].items()
|
||||
self._HOST = self._REGION + '.' + BLINK_URL
|
||||
self._HOST = self._REGION_ID + '.' + BLINK_URL
|
||||
self._AUTH_HEADER = {'Host': self._HOST,
|
||||
'TOKEN_AUTH': self._TOKEN
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ from setuptools import setup
|
||||
|
||||
setup(
|
||||
name = 'blinkpy',
|
||||
version = '0.4.',
|
||||
version = '0.4.4',
|
||||
description = 'A Blink camera Python library',
|
||||
long_description='A library that communicates with Blink cameras',
|
||||
author = 'Kevin Fronczak',
|
||||
|
||||
@@ -66,6 +66,7 @@ class TestBlinkRequests(unittest.TestCase):
|
||||
self.assertEqual(name, const.CAMERA_NAME)
|
||||
self.assertEqual(camera.armed, const.ARMED)
|
||||
self.assertEqual(camera.motion['video'], BASE_URL + const.THUMB + '.mp4')
|
||||
self.assertEqual(camera.header, const.auth_header)
|
||||
elif camera.id == str(const.DEVICE_ID2):
|
||||
self.assertEqual(name, const.CAMERA_NAME2)
|
||||
self.assertEqual(camera.armed, const.ARMED2)
|
||||
|
||||
+4
-1
@@ -24,7 +24,10 @@ if ISONLINE:
|
||||
ONLINE = 'online'
|
||||
else:
|
||||
ONLINE = 'offline'
|
||||
|
||||
|
||||
auth_header = {'Host': REGION_ID+'.immedia-semi.com',
|
||||
'TOKEN_AUTH': TOKEN
|
||||
}
|
||||
|
||||
response = {'account': {'notifications': 1},
|
||||
'devices': [{'device_type': 'camera',
|
||||
|
||||
Reference in New Issue
Block a user