Coinbase code quality improvements from review (#52307)
* Fix breaking loop if single bad currency * Remove unneeded update * Reduce executor calls and use helper * Avoid setting up integration when not needed in test * Remove defunct info from strings * Move already configured check * Move instance update out of data class init
This commit is contained in:
parent
b11af5e6f8
commit
897f5d9247
6 changed files with 38 additions and 28 deletions
|
@ -36,7 +36,6 @@ ATTRIBUTION = "Data provided by coinbase.com"
|
|||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
"""Set up Coinbase sensor platform."""
|
||||
instance = hass.data[DOMAIN][config_entry.entry_id]
|
||||
hass.async_add_executor_job(instance.update)
|
||||
|
||||
entities = []
|
||||
|
||||
|
@ -58,7 +57,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
"your settings in Coinbase's developer tools",
|
||||
currency,
|
||||
)
|
||||
break
|
||||
continue
|
||||
entities.append(AccountSensor(instance, currency))
|
||||
|
||||
if CONF_EXCHANGE_RATES in config_entry.options:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue