Merge pull request #1368 from Gerto/dev

Don't set Bitcoin wallet if not setup in configuration
This commit is contained in:
Paulus Schoutsen 2016-02-22 07:35:24 -08:00
commit b294383f20

View file

@ -58,12 +58,14 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
_LOGGER.error('Currency "%s" is not available. Using "USD".', currency)
currency = 'USD'
wallet = Wallet(wallet_id, password)
try:
wallet.get_balance()
except exceptions.APIException as error:
_LOGGER.error(error)
if wallet_id is not None and password is not None:
wallet = Wallet(wallet_id, password)
try:
wallet.get_balance()
except exceptions.APIException as error:
_LOGGER.error(error)
wallet = None
else:
wallet = None
data = BitcoinData()