Add update listener type hints to coinbase (#65414)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/64137/merge
parent
256ad084c5
commit
340146e5fb
|
@ -99,7 +99,7 @@ def create_and_update_instance(entry: ConfigEntry) -> CoinbaseData:
|
|||
return instance
|
||||
|
||||
|
||||
async def update_listener(hass, config_entry):
|
||||
async def update_listener(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
|
||||
"""Handle options update."""
|
||||
|
||||
await hass.config_entries.async_reload(config_entry.entry_id)
|
||||
|
@ -113,11 +113,11 @@ async def update_listener(hass, config_entry):
|
|||
for entity in entities:
|
||||
currency = entity.unique_id.split("-")[-1]
|
||||
if "xe" in entity.unique_id and currency not in config_entry.options.get(
|
||||
CONF_EXCHANGE_RATES
|
||||
CONF_EXCHANGE_RATES, []
|
||||
):
|
||||
registry.async_remove(entity.entity_id)
|
||||
elif "wallet" in entity.unique_id and currency not in config_entry.options.get(
|
||||
CONF_CURRENCIES
|
||||
CONF_CURRENCIES, []
|
||||
):
|
||||
registry.async_remove(entity.entity_id)
|
||||
|
||||
|
|
Loading…
Reference in New Issue