mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +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,13 +58,15 @@ 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'
|
||||||
|
|
||||||
|
if wallet_id is not None and password is not None:
|
||||||
wallet = Wallet(wallet_id, password)
|
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
|
wallet = None
|
||||||
|
else:
|
||||||
|
wallet = None
|
||||||
|
|
||||||
data = BitcoinData()
|
data = BitcoinData()
|
||||||
dev = []
|
dev = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user