Skip to content

Commit 359d693

Browse files
committed
Improved availablility handling for sync module
1 parent 8fe67ea commit 359d693

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

blinkpy/sync_module.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def start(self):
106106
"Could not extract some sync module info: %s", response, exc_info=True
107107
)
108108

109-
self.get_network_info()
109+
is_ok = self.get_network_info()
110110
self.check_new_videos()
111111
try:
112112
for camera_config in self.camera_list:
@@ -123,6 +123,8 @@ def start(self):
123123
)
124124
return False
125125

126+
if not is_ok:
127+
return False
126128
self.available = True
127129
return True
128130

@@ -156,10 +158,13 @@ def get_network_info(self):
156158

157159
if is_errored:
158160
self.available = False
161+
return False
162+
return True
159163

160164
def refresh(self, force_cache=False):
161165
"""Get all blink cameras and pulls their most recent status."""
162-
self.get_network_info()
166+
if not self.get_network_info():
167+
return
163168
self.check_new_videos()
164169
for camera_name in self.cameras.keys():
165170
camera_id = self.cameras[camera_name].camera_id

0 commit comments

Comments
 (0)