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

Commit

Permalink
Remove standing orders becuase of API error
Browse files Browse the repository at this point in the history
  • Loading branch information
toringer committed Mar 22, 2022
1 parent 6dd8497 commit db154af
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
1 change: 0 additions & 1 deletion custom_components/sbanken/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
ATTR_LAST_UPDATE = "last_update"
ATTR_TRANSACTIONS = "transactions"
ATTR_PAYMENTS = "payments"
ATTR_STANDING_ORDERS = "standing_orders"
ATTR_AMOUNT = "amount"
ATTR_FROM_ACCOUNT_ENTITY = "from_account_entity"
ATTR_TO_ACCOUNT_ENTITY = "to_account_entity"
Expand Down
11 changes: 0 additions & 11 deletions custom_components/sbanken/sbanken_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,6 @@ def get_payments(self, account_id: str, number_of_payments: int):
)
return response

def get_standing_orders(self, account_id: str):
"""Get standing orders"""
response = (
self.get_session()
.get(
f"https://publicapi.sbanken.no/apibeta/api/v2/StandingOrders/{account_id}"
)
.json()
)
return response

def transfer(
self,
from_account_id: str,
Expand Down
15 changes: 0 additions & 15 deletions custom_components/sbanken/sbanken_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
ATTR_LAST_UPDATE,
ATTR_NAME,
ATTR_PAYMENTS,
ATTR_STANDING_ORDERS,
ATTR_TRANSACTIONS,
DOMAIN,
)
Expand Down Expand Up @@ -56,7 +55,6 @@ def __init__(

self._transactions = []
self._payments = []
self._standing_orders = []
self._available = 0
self._balance = 0
self._account_name = account_name
Expand Down Expand Up @@ -97,7 +95,6 @@ def extra_state_attributes(self):
ATTR_LAST_UPDATE: self._last_updated,
ATTR_TRANSACTIONS: self._transactions,
ATTR_PAYMENTS: self._payments,
ATTR_STANDING_ORDERS: self._standing_orders,
}

async def async_update(self):
Expand All @@ -115,9 +112,6 @@ async def async_update(self):
self._account_id,
self.number_of_transactions,
)
standing_orders = await self.hass.async_add_executor_job(
self.api.get_standing_orders, self._account_id
)

if (
"available" in account
Expand Down Expand Up @@ -158,15 +152,6 @@ async def async_update(self):
f"Error updating payments {self._attr_name}. Payments: {str(payments)}"
)

if "items" in standing_orders:
self._standing_orders = standing_orders["items"]
self._last_updated = datetime.now()
_LOGGER.debug(f"Updating standing orders: {self._attr_name}")
else:
_LOGGER.warn(
f"Error updating standing orders {self._attr_name}. Standing orders: {str(standing_orders)}"
)


class CustomerInformationSensor(Entity):
"""Representation of a Sensor."""
Expand Down

0 comments on commit db154af

Please sign in to comment.