Skip to content

Commit

Permalink
Merge branch 'xaviertorras-master'
Browse files Browse the repository at this point in the history
* xaviertorras-master:
  Get Alerts UnArchived

Conflicts:
	README.md
  • Loading branch information
calmh committed Jun 22, 2014
2 parents 162e031 + 9f4a800 commit 773f5fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,16 @@ connection is of bad quality to force a rescan.

Return a list of Alerts.

### `get_alerts_unarchived(self)`

Return a list of unarchived Alerts.

### `get_events(self)`

Return a list of Events.

### `get_aps(self)`

Return a list of all AP:s, with significant information about each.

### `get_clients(self)`
Expand Down
7 changes: 7 additions & 0 deletions unifi/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ def get_alerts(self):
"""Return a list of all Alerts."""

return self._read(self.api_url + 'list/alarm')

def get_alerts_unarchived(self):
"""Return a list of Alerts unarchived."""

js = json.dumps({'_sort': '-time', 'archived':False})
params = urllib.urlencode({'json': js})
return self._read(self.api_url + 'list/alarm', params)

def get_events(self):
"""Return a list of all Events."""
Expand Down

0 comments on commit 773f5fc

Please sign in to comment.