Fix portfolio mode by adding secAccNo parameter to compactPortfolio#256
Conversation
| _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
|
Confirming this fix works on a FR account holding only savings-plan ETF and equity positions (the kind of account where master consistently returns an empty The change is minimal and the lazy fetch via |
|
While I don't see the issue on my account, I guess it helps some users, so merging this. I could obviously only verify that it still works on my account. |
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