Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to get the integration working again #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions custom_components/personalcapital/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"name": "Personal Capital",
"documentation": "https://github.com/custom-components/sensor.personalcapital/blob/master/README.md",
"dependencies": [],
"codeowners": ["@iantrich"],
"requirements": ["personalcapital==1.0.1"],
"version": "0.1.2"
"codeowners": [
"@iantrich"
],
"requirements": [
"git+https://github.com/sanghviharshit/personalcapital.git@master#739fb526514d2a68dc5e95f17e3c9ee49dd90f85"
],
"version": "0.1.3"
}
10 changes: 5 additions & 5 deletions custom_components/personalcapital/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from homeassistant.components.sensor import (PLATFORM_SCHEMA)
from homeassistant.util import Throttle

__version__ = '0.1.1'
__version__ = '0.1.2'

REQUIREMENTS = ['personalcapital==1.0.1']
# REQUIREMENTS = ['personalcapital==1.0.1']

CONF_EMAIL = 'email'
CONF_PASSWORD = 'password'
Expand Down Expand Up @@ -71,7 +71,7 @@ def personalcapital_configuration_callback(data):
"""Run when the configuration callback is called."""
from personalcapital import PersonalCapital, RequireTwoFactorException, TwoFactorVerificationModeEnum
pc.two_factor_authenticate(TwoFactorVerificationModeEnum.SMS, data.get('verification_code'))
result = pc.authenticate_password(config.get(CONF_PASSWORD))
result = pc.authenticate_password(config.get(CONF_EMAIL), config.get(CONF_PASSWORD))

if result == RequireTwoFactorException:
configurator.notify_errors(_CONFIGURING['personalcapital'], "Invalid verification code")
Expand Down Expand Up @@ -189,7 +189,7 @@ def icon(self):
return 'mdi:coin'

@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the state attributes of the sensor."""
attributes = {
ATTR_ASSETS: self._assets,
Expand Down Expand Up @@ -255,7 +255,7 @@ def icon(self):
return 'mdi:coin'

@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the state attributes of the sensor."""
return self.hass.data[self._productType]

Expand Down