diff --git a/get-history-list.js b/get-history-list.js index b44a9d7..74d2124 100644 --- a/get-history-list.js +++ b/get-history-list.js @@ -21,7 +21,7 @@ module.exports = bottle => bottle.service( 'getHistoryList', getHistoryList, 'restClient', 'apiUrls' ) -function getHistoryList( restClient, apiUrls ) { +function getHistoryList( restClient, apiUrls, limit ) { class HistoryItem { @@ -47,9 +47,9 @@ function getHistoryList( restClient, apiUrls ) { } } - return async() => { + return async( limit ) => { const historyListUrl = apiUrls.doorbots().history() - const historyItems = await restClient.authenticatedRequest( 'GET', historyListUrl ) + const historyItems = await restClient.authenticatedRequest( 'GET', `${historyListUrl}?limit=${limit || 20}` ) return historyItems.map( h => new HistoryItem( h )) } diff --git a/package.json b/package.json index 3d007d1..8c16448 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ring-api", - "version": "3.0.7", + "version": "3.0.8", "description": "Unofficial API for ring doorbells and other devices", "main": "main.js", "dependencies": {