Skip to content
Merged
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
12 changes: 9 additions & 3 deletions homeassistant/components/digital_ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from homeassistant.util import Throttle
import homeassistant.helpers.config_validation as cv

REQUIREMENTS = ['python-digitalocean==1.12']
REQUIREMENTS = ['python-digitalocean==1.13.2']

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -44,13 +44,19 @@

def setup(hass, config):
"""Set up the Digital Ocean component."""
import digitalocean

conf = config[DOMAIN]
access_token = conf.get(CONF_ACCESS_TOKEN)

digital = DigitalOcean(access_token)

if not digital.manager.get_account():
_LOGGER.error("No Digital Ocean account found for the given API Token")
try:
if not digital.manager.get_account():
_LOGGER.error("No account found for the given API token")
return False
except digitalocean.baseapi.DataReadError:
_LOGGER.error("API token not valid for authentication")
return False

hass.data[DATA_DIGITAL_OCEAN] = digital
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ python-blockchain-api==0.0.2
python-clementine-remote==1.0.1

# homeassistant.components.digital_ocean
python-digitalocean==1.12
python-digitalocean==1.13.2

# homeassistant.components.ecobee
python-ecobee-api==0.0.14
Expand Down