Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use network_status instead of homescreen #119

Merged
merged 7 commits into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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