Fix error with updating owl information during refresh
This commit is contained in:
@@ -4,7 +4,7 @@ import os
|
|||||||
|
|
||||||
MAJOR_VERSION = 0
|
MAJOR_VERSION = 0
|
||||||
MINOR_VERSION = 16
|
MINOR_VERSION = 16
|
||||||
PATCH_VERSION = "0-rc7"
|
PATCH_VERSION = "0-rc8"
|
||||||
|
|
||||||
__version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}"
|
__version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}"
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ class BlinkSyncModule:
|
|||||||
return response["camera"][0]
|
return response["camera"][0]
|
||||||
except (TypeError, KeyError):
|
except (TypeError, KeyError):
|
||||||
_LOGGER.error("Could not extract camera info: %s", response, exc_info=True)
|
_LOGGER.error("Could not extract camera info: %s", response, exc_info=True)
|
||||||
return []
|
return {}
|
||||||
|
|
||||||
def get_network_info(self):
|
def get_network_info(self):
|
||||||
"""Retrieve network status."""
|
"""Retrieve network status."""
|
||||||
@@ -191,7 +191,9 @@ class BlinkSyncModule:
|
|||||||
self.check_new_videos()
|
self.check_new_videos()
|
||||||
for camera_name in self.cameras.keys():
|
for camera_name in self.cameras.keys():
|
||||||
camera_id = self.cameras[camera_name].camera_id
|
camera_id = self.cameras[camera_name].camera_id
|
||||||
camera_info = self.get_camera_info(camera_id)
|
camera_info = self.get_camera_info(
|
||||||
|
camera_id, owl_info=self.get_owl_info(camera_name)
|
||||||
|
)
|
||||||
self.cameras[camera_name].update(camera_info, force_cache=force_cache)
|
self.cameras[camera_name].update(camera_info, force_cache=force_cache)
|
||||||
self.available = True
|
self.available = True
|
||||||
|
|
||||||
|
|||||||
@@ -80,11 +80,11 @@ class TestBlinkSyncModule(unittest.TestCase):
|
|||||||
def test_get_camera_info_fail(self, mock_resp):
|
def test_get_camera_info_fail(self, mock_resp):
|
||||||
"""Test handling of failed get camera info function."""
|
"""Test handling of failed get camera info function."""
|
||||||
mock_resp.return_value = None
|
mock_resp.return_value = None
|
||||||
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), [])
|
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), {})
|
||||||
mock_resp.return_value = {}
|
mock_resp.return_value = {}
|
||||||
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), [])
|
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), {})
|
||||||
mock_resp.return_value = {"camera": None}
|
mock_resp.return_value = {"camera": None}
|
||||||
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), [])
|
self.assertEqual(self.blink.sync["test"].get_camera_info("1"), {})
|
||||||
|
|
||||||
def test_get_network_info(self, mock_resp):
|
def test_get_network_info(self, mock_resp):
|
||||||
"""Test network retrieval."""
|
"""Test network retrieval."""
|
||||||
|
|||||||
Reference in New Issue
Block a user