From 0d35854dfe322c6b5d259b81225743333f4aeb37 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Mon, 3 Jun 2024 19:39:06 +1000 Subject: [PATCH] set page size to 100 for accounts --- custom_components/up/manifest.json | 2 +- custom_components/up/up.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/up/manifest.json b/custom_components/up/manifest.json index 4fea605..ed0502c 100644 --- a/custom_components/up/manifest.json +++ b/custom_components/up/manifest.json @@ -3,7 +3,7 @@ "name": "Up Bank Integration", "dependencies": ["http"], "codeowners": ["@jay-oswald"], - "version": "0.1.0", + "version": "0.2.0", "integration_type": "hub", "config_flow": true, "iot_class": "cloud_polling" diff --git a/custom_components/up/up.py b/custom_components/up/up.py index 8111bf3..8beac42 100644 --- a/custom_components/up/up.py +++ b/custom_components/up/up.py @@ -9,12 +9,12 @@ class UP: def __init__(self, key): self.api_key = key; - async def call(self, endpoint, data = {}, method="get"): + async def call(self, endpoint, params = {}, method="get"): headers = { "Authorization": "Bearer " + self.api_key} match method: case "get": async with aiohttp.ClientSession(headers=headers) as session: - async with session.get(base + endpoint) as resp: + async with session.get(base + endpoint, params=params) as resp: resp.data = await resp.json() return resp @@ -27,7 +27,7 @@ async def test(self, api_key) -> bool: return result.status == 200 async def getAccounts(self): - result = await self.call('/accounts') + result = await self.call('/accounts',{"page[size]": 100}) if(result.status != 200): return False