diff --git a/ring_doorbell/__init__.py b/ring_doorbell/__init__.py index a23b6d26..8fd2fe12 100644 --- a/ring_doorbell/__init__.py +++ b/ring_doorbell/__init__.py @@ -485,7 +485,7 @@ def existing_doorbell_type_duration(self, value): return True return None - def history(self, limit=30, timezone=None): + def history(self, limit=30, timezone=None, kind=None): """Return history with datetime objects.""" # allow modify the items to return params = {'limit': str(limit)} @@ -508,6 +508,10 @@ def history(self, limit=30, timezone=None): entry['created_at'] = tz_dt else: entry['created_at'] = utc_dt + + if kind: + return list(filter(lambda array: array['kind'] == kind, response)) + return response @property