Skip to content

Commit

Permalink
Merge pull request #119 from md-reddevil/dev
Browse files Browse the repository at this point in the history
Use network_status instead of homescreen
  • Loading branch information
fronzbot authored Nov 19, 2018
2 parents 4241b50 + 3c78923 commit 1aa5dc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion blinkpy/sync_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(self, blink):
self.host = None
self.summary = None
self.homescreen = None
self.network_info = None
self.record_dates = {}
self.videos = {}
self.events = []
Expand Down Expand Up @@ -64,7 +65,7 @@ def online(self):
@property
def arm(self):
"""Return status of sync module: armed/disarmed."""
return self.homescreen['network']['armed']
return self.network_info['network']['armed']

@arm.setter
def arm(self, value):
Expand All @@ -88,6 +89,9 @@ def start(self):

self.homescreen = api.request_homescreen(self.blink)

self.network_info = api.request_network_status(self.blink,
self.network_id)

camera_info = self.get_camera_info()
for camera_config in camera_info:
name = camera_config['name']
Expand All @@ -114,6 +118,8 @@ def refresh(self, force_cache=False):
self.events = self.get_events()
self.videos = self.get_videos()
self.homescreen = api.request_homescreen(self.blink)
self.network_info = api.request_network_status(self.blink,
self.network_id)
camera_info = self.get_camera_info()
for camera_config in camera_info:
name = camera_config['name']
Expand Down
1 change: 1 addition & 0 deletions tests/test_sync_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def test_sync_start(self, mock_resp):
'status': 'foobar'}},
{'event': True},
{},
{},
{'devicestatus': {}},
None,
None
Expand Down

0 comments on commit 1aa5dc1

Please # to comment.