Skip to content
Snippets Groups Projects
Commit b294383f authored by Paulus Schoutsen's avatar Paulus Schoutsen
Browse files

Merge pull request #1368 from Gerto/dev

Don't set Bitcoin wallet if not setup in configuration
parents 5bd0b5ab cbe27d8f
No related branches found
No related tags found
No related merge requests found
...@@ -58,12 +58,14 @@ def setup_platform(hass, config, add_devices, discovery_info=None): ...@@ -58,12 +58,14 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
_LOGGER.error('Currency "%s" is not available. Using "USD".', currency) _LOGGER.error('Currency "%s" is not available. Using "USD".', currency)
currency = 'USD' currency = 'USD'
wallet = Wallet(wallet_id, password) if wallet_id is not None and password is not None:
wallet = Wallet(wallet_id, password)
try: try:
wallet.get_balance() wallet.get_balance()
except exceptions.APIException as error: except exceptions.APIException as error:
_LOGGER.error(error) _LOGGER.error(error)
wallet = None
else:
wallet = None wallet = None
data = BitcoinData() data = BitcoinData()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment