Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Commit db154af

Browse files
committedMar 22, 2022
Remove standing orders becuase of API error
1 parent 6dd8497 commit db154af

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed
 

‎custom_components/sbanken/const.py

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
ATTR_LAST_UPDATE = "last_update"
1818
ATTR_TRANSACTIONS = "transactions"
1919
ATTR_PAYMENTS = "payments"
20-
ATTR_STANDING_ORDERS = "standing_orders"
2120
ATTR_AMOUNT = "amount"
2221
ATTR_FROM_ACCOUNT_ENTITY = "from_account_entity"
2322
ATTR_TO_ACCOUNT_ENTITY = "to_account_entity"

‎custom_components/sbanken/sbanken_api.py

-11
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,6 @@ def get_payments(self, account_id: str, number_of_payments: int):
107107
)
108108
return response
109109

110-
def get_standing_orders(self, account_id: str):
111-
"""Get standing orders"""
112-
response = (
113-
self.get_session()
114-
.get(
115-
f"https://publicapi.sbanken.no/apibeta/api/v2/StandingOrders/{account_id}"
116-
)
117-
.json()
118-
)
119-
return response
120-
121110
def transfer(
122111
self,
123112
from_account_id: str,

‎custom_components/sbanken/sbanken_entities.py

-15
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
ATTR_LAST_UPDATE,
2020
ATTR_NAME,
2121
ATTR_PAYMENTS,
22-
ATTR_STANDING_ORDERS,
2322
ATTR_TRANSACTIONS,
2423
DOMAIN,
2524
)
@@ -56,7 +55,6 @@ def __init__(
5655

5756
self._transactions = []
5857
self._payments = []
59-
self._standing_orders = []
6058
self._available = 0
6159
self._balance = 0
6260
self._account_name = account_name
@@ -97,7 +95,6 @@ def extra_state_attributes(self):
9795
ATTR_LAST_UPDATE: self._last_updated,
9896
ATTR_TRANSACTIONS: self._transactions,
9997
ATTR_PAYMENTS: self._payments,
100-
ATTR_STANDING_ORDERS: self._standing_orders,
10198
}
10299

103100
async def async_update(self):
@@ -115,9 +112,6 @@ async def async_update(self):
115112
self._account_id,
116113
self.number_of_transactions,
117114
)
118-
standing_orders = await self.hass.async_add_executor_job(
119-
self.api.get_standing_orders, self._account_id
120-
)
121115

122116
if (
123117
"available" in account
@@ -158,15 +152,6 @@ async def async_update(self):
158152
f"Error updating payments {self._attr_name}. Payments: {str(payments)}"
159153
)
160154

161-
if "items" in standing_orders:
162-
self._standing_orders = standing_orders["items"]
163-
self._last_updated = datetime.now()
164-
_LOGGER.debug(f"Updating standing orders: {self._attr_name}")
165-
else:
166-
_LOGGER.warn(
167-
f"Error updating standing orders {self._attr_name}. Standing orders: {str(standing_orders)}"
168-
)
169-
170155

171156
class CustomerInformationSensor(Entity):
172157
"""Representation of a Sensor."""

0 commit comments

Comments
 (0)
This repository has been archived.