Fix portfolio mode by adding secAccNo parameter to compactPortfolio#256
Fix portfolio mode by adding secAccNo parameter to compactPortfolio#256maximilian-sh wants to merge 1 commit intopytr-org:masterfrom
Conversation
pytr/api.py
Outdated
| _subscription_id_counter = 1 | ||
| _previous_responses: Dict[str, str] = {} | ||
| subscriptions: Dict[str, Dict[str, Any]] = {} | ||
| secAccNo = None |
There was a problem hiding this comment.
I would make this private
There was a problem hiding this comment.
Done, renamed to _secAccNo.
| self.secAccNo = account["id"] | ||
| break | ||
| return settings_data | ||
|
|
There was a problem hiding this comment.
Are all these locations still relevant to try?
In my case the securities account number is stored in settings_data["securitiesAccountNumber"]
There was a problem hiding this comment.
Good point — simplified to only use settings_data["securitiesAccountNumber"]. The other fallbacks were speculative. Same field works for me as well.
cbfe507 to
d43535b
Compare
408e7c4 to
96c5c15
Compare
|
Looked at the code again and reworked it a bit — moved |
96c5c15 to
60dda81
Compare
Fixes #246
The Trade Republic API now requires
secAccNoin thecompactPortfoliosubscription. Without it the API returns an empty portfolio silently.Changes
securitiesAccountNumberfromsettings()response intoself._sec_acc_nosecAccNoincompact_portfolio(), fetching it lazily if not yet availableTesting