Skip to content

Commit

Permalink
💵 sync monitored names with displayed names
Browse files Browse the repository at this point in the history
  • Loading branch information
iantrich committed Jan 14, 2019
1 parent b51a732 commit 5156feb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Version](https://img.shields.io/badge/version-0.0.9-green.svg?style=for-the-badge)](#) [![mantained](https://img.shields.io/maintenance/yes/2019.svg?style=for-the-badge)](#)
[![Version](https://img.shields.io/badge/version-0.1.0-green.svg?style=for-the-badge)](#) [![mantained](https://img.shields.io/maintenance/yes/2019.svg?style=for-the-badge)](#)

[![maintainer](https://img.shields.io/badge/maintainer-Ian%20Richardson%20%40iantrich-blue.svg?style=for-the-badge)](#)

Expand All @@ -11,7 +11,7 @@ Hey dude! Help me out for a couple of :beers: or a :coffee:!
Personal Capital component for [Home Assistant](https://www.home-assistant.io/)

To get started put `/custom_components/sensor/personalcapital.py` here:
`<config directory>/custom_components/sensor/personalcapital.py`. You can use this component with the custom [Personal Capital Lovelace card](https://github.com/custom-cards/pc-card).
`<config directory>/custom_components/sensor/personalcapital.py`. You can use this component with the custom [Personal Capital Lovelace card](https://github.com/custom-cards/pc-card).

**Example configuration.yaml:**

Expand All @@ -22,8 +22,8 @@ sensor:
password: 12345
unit_of_measurement: CAD
monitored_categories:
- assets
- investments
- cash
```
**Configuration variables:**
Expand All @@ -34,7 +34,7 @@ key | description
**email (Required)** | Email for personalcapital.com
**password (Required)** | Password for personalcapital.com
**unit_of_measurement (Optional)** | Unit of measurement for your accounts **Default** USD
**monitored_categories (Optional)** | Banking categories to monitor. By default all categories are monitored. Options are `investments, mortgages, cash, other_assets, other_liabilities, credit_cards, loans`
**monitored_categories (Optional)** | Banking categories to monitor. By default all categories are monitored. Options are `investment, mortgage, cash, other_asset, other_liability, credit, loan`
***

**Note: You'll get a text message with your pin code to use on the frontend to configure**
Expand Down
24 changes: 12 additions & 12 deletions custom_components/sensor/personalcapital.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from homeassistant.components.sensor import (PLATFORM_SCHEMA)
from homeassistant.util import Throttle

__version__ = '0.0.9'
__version__ = '0.1.0'

REQUIREMENTS = ['personalcapital==1.0.1']

Expand All @@ -30,25 +30,25 @@
ATTR_NETWORTH = 'networth'
ATTR_ASSETS = 'assets'
ATTR_LIABILITIES = 'liabilities'
ATTR_INVESTMENTS = 'investments'
ATTR_MORTGAGES = 'mortgages'
ATTR_INVESTMENT = 'investment'
ATTR_MORTGAGE = 'mortgage'
ATTR_CASH = 'cash'
ATTR_OTHER_ASSETS = 'other_assets'
ATTR_OTHER_LIABILITIES = 'other_liabilities'
ATTR_CREDIT = 'credit_cards'
ATTR_LOANS = 'loans'
ATTR_OTHER_ASSET = 'other_asset'
ATTR_OTHER_LIABILITY = 'other_liability'
ATTR_CREDIT = 'credit'
ATTR_LOAN = 'loan'

SCAN_INTERVAL = timedelta(minutes=30)
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=5)

SENSOR_TYPES = {
ATTR_INVESTMENTS: ['INVESTMENT', '', 'investmentAccountsTotal', 'Investment', False],
ATTR_MORTGAGES: ['MORTGAGE', '', 'mortgageAccountsTotal', 'Mortgage', True],
ATTR_INVESTMENT: ['INVESTMENT', '', 'investmentAccountsTotal', 'Investment', False],
ATTR_MORTGAGE: ['MORTGAGE', '', 'mortgageAccountsTotal', 'Mortgage', True],
ATTR_CASH: ['BANK', 'Cash', 'cashAccountsTotal', 'Cash', False],
ATTR_OTHER_ASSETS: ['OTHER_ASSETS', '', 'otherAssetAccountsTotal', 'Other Asset', False],
ATTR_OTHER_LIABILITIES: ['OTHER_LIABILITIES', '', 'otherLiabilitiesAccountsTotal', 'Other Liability', True],
ATTR_OTHER_ASSET: ['OTHER_ASSETS', '', 'otherAssetAccountsTotal', 'Other Asset', False],
ATTR_OTHER_LIABILITY: ['OTHER_LIABILITIES', '', 'otherLiabilitiesAccountsTotal', 'Other Liability', True],
ATTR_CREDIT: ['CREDIT_CARD', '', 'creditCardAccountsTotal', 'Credit', True],
ATTR_LOANS: ['LOAN', '', 'loanAccountsTotal', 'Loan', True],
ATTR_LOAN: ['LOAN', '', 'loanAccountsTotal', 'Loan', True],
}

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
Expand Down

0 comments on commit 5156feb

Please sign in to comment.