diff --git a/CHANGES.rst b/CHANGES.rst index 51ad7ce7..2e592afe 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,11 @@ Changelog A list of changes between each release +0.11.2 (2019-01-23) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- Hotfix to prevent platform from stalling due to API change +- Motion detection and video recovery broken until new API endpoint discovered + 0.11.1 (2019-01-02) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Fixed incorrect backup login url diff --git a/blinkpy/helpers/constants.py b/blinkpy/helpers/constants.py index 947a6ce0..c48ea3ff 100644 --- a/blinkpy/helpers/constants.py +++ b/blinkpy/helpers/constants.py @@ -4,7 +4,7 @@ MAJOR_VERSION = 0 MINOR_VERSION = 11 -PATCH_VERSION = 1 +PATCH_VERSION = 2 __version__ = '{}.{}.{}'.format(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION) diff --git a/blinkpy/sync_module.py b/blinkpy/sync_module.py index b59c7a49..75c02c1f 100644 --- a/blinkpy/sync_module.py +++ b/blinkpy/sync_module.py @@ -139,15 +139,24 @@ def get_videos(self, start_page=0, end_page=1): this_page = api.request_videos(self.blink, page=page_num) if not this_page: break + elif 'message' in this_page: + _LOGGER.warning("Could not retrieve videos. Message: %s", + this_page['message']) + break + videos.append(this_page) _LOGGER.debug("Getting videos from page %s through %s", start_page, end_page) for page in videos: for entry in page: - camera_name = entry['camera_name'] - clip_addr = entry['address'] - thumb_addr = entry['thumbnail'] + try: + camera_name = entry['camera_name'] + clip_addr = entry['address'] + thumb_addr = entry['thumbnail'] + except TypeError: + _LOGGER.warning("Could not extract video information.") + break clip_date = clip_addr.split('_')[-6:] clip_date = '_'.join(clip_date) clip_date = clip_date.split('.')[0]