diff --git a/homeassistant/components/sensor/bitcoin.py b/homeassistant/components/sensor/bitcoin.py index d2b05d774e49a6fd173eaf63240ee7c7ed8ea43a..a92b20a4ceeba361dd7fdff1e5d9c74832548167 100644 --- a/homeassistant/components/sensor/bitcoin.py +++ b/homeassistant/components/sensor/bitcoin.py @@ -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()