Skip to content

Commit

Permalink
Allow users that don't pay for monthly monitoring to still access sys…
Browse files Browse the repository at this point in the history
…tem status.
  • Loading branch information
w1ll1am23 committed Jul 16, 2018
1 parent ef296e6 commit b91adbc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## 2.0.1
- Allow users without monthly monitoring to get system status

## 2.0.0
- Moving to the new API

Expand Down
2 changes: 1 addition & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

setup(name='simplisafe-python',
version='2.0.0',
version='2.0.1',
description='Python 3 support for SimpliSafe alarm',
url='https://github.com/w1ll1am23/simplisafe-python',
author='William Scanlon',
Expand Down
10 changes: 7 additions & 3 deletions src/simplipy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,15 @@ def _get_systems_devices_states(self, location_id, cached=True):
_LOGGER.error("Token expired, getting new token")
self._refresh_token()
return False
if response.status_code != 200:
_LOGGER.error("Failed to pull updated sensor states")
return False
try:
_json = response.json()
if response.status_code != 200:
if _json.get("errorType") == "NoRemoteManagement":
_LOGGER.error("No monthly monitoring on account, only system status is availble")
self.sensors[location_id] = {}
return True
_LOGGER.error("Failed to pull updated sensor states")
return False
except ValueError:
_LOGGER.error("Failed to decode JSON")
return False
Expand Down

0 comments on commit b91adbc

Please sign in to comment.