mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Merge pull request #1368 from Gerto/dev
Don't set Bitcoin wallet if not setup in configuration
This commit is contained in:
commit
b294383f20
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user