Improved availablility handling for sync module

This commit is contained in:
Kevin Fronczak
2020-05-25 13:40:48 +00:00
parent 8fe67ea574
commit 359d6930b4
+7 -2
View File
@@ -106,7 +106,7 @@ class BlinkSyncModule:
"Could not extract some sync module info: %s", response, exc_info=True
)
self.get_network_info()
is_ok = self.get_network_info()
self.check_new_videos()
try:
for camera_config in self.camera_list:
@@ -123,6 +123,8 @@ class BlinkSyncModule:
)
return False
if not is_ok:
return False
self.available = True
return True
@@ -156,10 +158,13 @@ class BlinkSyncModule:
if is_errored:
self.available = False
return False
return True
def refresh(self, force_cache=False):
"""Get all blink cameras and pulls their most recent status."""
self.get_network_info()
if not self.get_network_info():
return
self.check_new_videos()
for camera_name in self.cameras.keys():
camera_id = self.cameras[camera_name].camera_id