Add credit card management features#17
Conversation
… credit-card-management
|
Thanks for the PR, the CC features look good. But this branch looks to be based on an older version of Can you update your branch with the latest |
2df679e to
69963ef
Compare
|
I’ve rebased credit-card-management onto the latest main and pushed updates (including the Ready to Assign fix). Could you please re-check? |
|
Thanks, but I think something still went wrong with the rebase/update. The PR is still removing some newer changes already in Can you please check your branch again against current |
|
Sorry; can you check one more time? |
|
Thanks for the update, this looks a lot better now and the PR seems to be down to the Credit Card related changes only. I do not use credit cards in YNAB myself, so while the changes look reasonable from the diff, I am not fully sure if this is the best general approach for how credit accounts should be handled. A few things I wanted to get your feedback on before I test it:
It may suit your own setup already, but I just want to make sure it also lines up with how YNAB generally handles these accounts and how most users would expect them to work. I am going to pull this locally and test the changes over the next couple of days before I merge it. |
|
I limited the due day to 1-28 because many/most credit card companies wouldn't have a due date after the 28th, since it would then change on February. I at least have never seen it as an option. From what I can tell with my own account data, the different fields are setup to only apply to appropriate account types (both loans and credit cards have an APR, but only credit cards have credit limits, etc.) And yes; utilization/available credit are credit card specific. I've tested this across all the different accounts I know of within YNAB. |
|
Thanks, that makes sense. I will pull it locally and test it on my side over the next couple of days before I merge it. |
|
Thanks for working on credit-related features. Persisting a few HA-only fields is reasonable because the YNAB API does not expose credit limit, APR, or payment due day on the normal I do not think this should merge as-is. The current shape fights how this integration is structured and will confuse people who rely on the config flow. How this integration is usually structured
What is hard to accept in the current PRDuplicate account surface Extras pollution + always-on entities Fights the existing pattern Config flow and cleanup Suggested direction
If you want to iterate toward that shape, I am happy to help review a follow-up that keeps the useful persistence bits but matches the existing layout and the config flow. If anything in the above is unclear, say what you prefer and we can align on it before you spend more time on it. |
|
Thanks for the thorough review and for taking time to lay out the preferred structure. I want to push back on a few points so my intent is clear: Per-account device structure “Extras pollution” concern Applicability for non-credit users Duplicate account surface I’m completely open to hardening the config-flow alignment and teardown behavior, but I’d like to preserve the core model of account-centric credit management instead of moving everything into account attributes + Extras attributes only. If that architectural direction is still a hard no for this repo, I understand and can maintain this branch separately. But if there’s room for compromise, I can submit a follow-up that keeps the account-centric model while adding stricter gating/cleanup so the UX stays clean for non-credit setups. |
|
Thanks for the follow-up. I think we are aligned on the hygiene side overall. Selection, gating, and cleanup
API alignment (briefly)
HA-only configuration (limit, APR, due day)
Extras / budget-wide rollups
If this upstream direction is not what you want for your own install
What I am planning on my side
|
|
Since each credit account has a different due date, interest rate, and credit limit, how exactly do you envision that being setup? A single credit 'device', with different entries for each credit account? That could make for a long and confusing list on a single device (particularly since they are HA-native inputs, and there are 3 per account). |
|
This pull request has been marked as stale due to inactivity. It will be closed in 7 days unless there is activity. |
|
Sorry for the slow reply here, I’ve been pretty busy and this sat longer than I meant it to. I’ve tested the PR, and I do agree that both approaches have trade-offs and can get messy in different ways. Before deciding on the final structure, I’d like to try a few alternate methods and see if there’s a cleaner way to handle it. In the meantime, feel free to keep using your own version if it works well for your setup. If I find a method I’m happier with, I’ll release it as a beta so you can test it and see what you think. If I can’t find a cleaner solution, I’ll come back and revisit this approach rather than ruling it out completely. I’ll keep the PR open for now so the stale bot doesn’t close it. Thanks again for the work on this. |
|
🙂 Sounds reasonable. I'll keep an eye out for alternative approaches. |
PR Description
Add Credit Card Management Features
This PR enhances the YNAB Home Assistant integration with comprehensive credit card management capabilities, including sensors for monitoring credit utilization and available credit, plus editable number entities for managing credit limits, APR rates, and payment due dates.
New Features
Sensors:
Total Credit Limit- Sum of all credit card limitsTotal Credit Utilization- Overall utilization percentage across all cardsTotal Available Credit- Combined available credit across all cards{Card Name} Utilization- Per-card utilization %{Card Name} Available Credit- Per-card available creditNumber Entities (Configurable):
{Card Name} Credit Limit- Editable credit limit{Card Name} APR- Annual percentage rate (0-40%){Card Name} Due Day- Monthly payment due date (1-28)Key Changes
number.pywith credit card number entitiescoordinator.pywith persistent storage for user valuessensor.pywith credit card monitoring sensorsmanifest.jsonto includenumberplatformConfiguration
After installation, credit card accounts are automatically detected. Configure limits/APR/due days through the number entities in HA. Sensors update based on YNAB data.
Data Storage
User-configured values (limits, APR, due days) are stored in HA's config storage and persist across restarts.
Compatibility
Testing
Tested with multiple credit card accounts, various currencies, and HA restart scenarios. All sensors and number entities function correctly.